We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

how to transfer data between Event class and Controller

Hi there, I write an event class, and trigger it on beforeExecuteRoute, So I want pass some parameters to Controller class. For example: User property and ....

How can I do this? Do I have to use session or exist alternative method ?

Thanks

just put it in $this->User ... :) if u have baseController it is good to place some public/private/protected var public $user_property; ... and after in beforeExecuteRoute function put the data $this->user_property = "some" ...

Maybe i didnt get the problem, sorry if...