Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Editing $db = array() values via Controller

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 315 Views
  • theGermaniac
    Avatar
    Community Member
    82 Posts

    Editing $db = array() values via Controller Link to this post

    Hi,

    I execute a function from the controller and want to update a variable stored at $db = array(), but I don't get it...

    Here is a pastie with my code: http://pastie.org/8376525

    Thanks.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Editing $db = array() values via Controller Link to this post

    Looks like you're there. You should be able to call the URL of your page such as mysite.com/mypage/makeUpdate and it should run. Do you get an error? That makeUpdate function should probably return something, either redirect the user to another page or show them some sort of error message.

  • theGermaniac
    Avatar
    Community Member
    82 Posts

    Re: Editing $db = array() values via Controller Link to this post

    This is so wired.

    When I access the variable in the controller, it contains the correct values, but it seems, that they are not written to the database.

    Means, when I try to read em back in - either via the controller or the CMS backend - they don't contain the changes.

    Sorry, no error message, even nothing inside the Apache logs.

    315 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.