Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Saving persistent data

Is saving persistent data like an array of objects... in $this->persistent->myData in controllers is a good way , and is it stored in the RAM of the servers.


No it is saved in your session. You need to initialize session first to use $this->persistent.

for example:

class DictionaryController extends \Phalcon\Mvc\Controller
    public function indexAction()
        $this->persistent->testing_key = "my test value";

    public function showAction()
        echo "<pre>";

you get

    [_started] => 1
    [DictionaryController] => Array
            [testing_key] => my test value

Persistent makes Class name session key and add to it key=>value

edited Apr '14

in the tutorial of INVO project, in the Security Plugin, they saved the ACL in the $this->persistent. Which is the same for all users!