Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

Editing $db = array() values via Controller

Go to End

3 Posts   996 Views


Community Member, 107 Posts

4 October 2013 at 4:34pm


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:



Forum Moderator, 5523 Posts

4 October 2013 at 7:52pm

Looks like you're there. You should be able to call the URL of your page such as 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.


Community Member, 107 Posts

4 October 2013 at 7:56pm

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.