-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twig global variable doesnt work #24
Comments
This is not a bug in Twig or codeigniter-ss-twig. It is specification.
Twig's global also means global in a single request.
Yes. |
Thank you for your answer. |
If you need one variable in all pages, for example, you can set it in your MY_Controller constructor. |
Thanks this one can solve my problem. But i think you can add this feature to project then we can reach the session with session key in twig. So we do not need to add any variable or make our own controllers. |
I intend to keep this library simple wrapper for Twig. You can extend my Twig class to add your own needs. |
Hi im adding global variable in my login controller.
In my dashboard.twig file im calling
{{ user_session.fullName}}
but it doesnt work.BUT
If i use addGlobal method in my dashboard i can see the fullName variable. In this case it doesnt work for another controllers, works for only dashboard. But i need to use it in every controller.
The text was updated successfully, but these errors were encountered: