Comments (5)
This is not a bug in Twig or codeigniter-ss-twig. It is specification.
redirect()
makes your browser request another page (in your case, dashboard).
HTTP is stateless protocol. And PHP also shares nothing basically.
So if you access another page, PHP don't know all variables in the previous page at all.
Twig's global also means global in a single request.
But i need to use it in every controller.
Yes.
from codeigniter-ss-twig.
Thank you for your answer.
Is there any way that i can define global variable for twig which is works in every request ?
from codeigniter-ss-twig.
If you need one variable in all pages, for example, you can set it in your MY_Controller constructor.
See https://codeigniter.com/user_guide/general/core_classes.html#extending-core-class.
from codeigniter-ss-twig.
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.
from codeigniter-ss-twig.
I intend to keep this library simple wrapper for Twig.
I don't add functionality which original Twig does not have.
Twig doesn't care about session.
You can extend my Twig class to add your own needs.
See #23 (comment).
from codeigniter-ss-twig.
Related Issues (20)
- Right way to add function like form_open() without | raw HOT 2
- form helper HOT 1
- How to use session flashdata function HOT 1
- Unable to use form helpers
- Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead. HOT 2
- Trying to use ckeditor and ckFinder with twig and CI HOT 2
- Session flashdata HOT 1
- Add function in twig HOT 2
- Sensiolabs security checker says the twig version you are using has a vulnerability HOT 3
- translation with twig and ci HOT 2
- support for the new version ci4 HOT 3
- Class 'Twig_Loader_Filesystem' not found error HOT 2
- Truncate filter does not work HOT 2
- Any possibility of making one for codeigniter 4? HOT 3
- missing cache configuration HOT 1
- way to pass more config to twig environment HOT 2
- Adding filters HOT 6
- Memory leak in development mode if twig syntax incorrect HOT 1
- Class 'Kenjis\CI4Twig\Twig' not found in CI4 HOT 1
- Using official filters from Twig HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter-ss-twig.