We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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.



125.8k
Accepted
answer

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

{{ session.someValue }}


169

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