We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Phalconphp on what is the best way to use Session Data in the main view

I've been reading the documentation and it is not clear how to use the session data in the main view. Thanks in advance.


I believe anything in the DI is accessible in the view, so you could do:

{{ session.someValue }}


Wait so we can access it like that? I always just set a variable in my BaseController and then access it in the view :/