Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Twig caches variable

Started by Muut Archive 10 years ago · 1 replies · 370 views
10 years ago

Hi, I have problem with passing variable into twig. I use $twig->twig_vars to pass variable to twig template, but when I use caching this var is some kind cached also so there are wrong data. When disable chaching or swhitch debugger on, works well and variable is passed properly.

Do you have any suggestins to fix this issue and keep chaching working?

Thnx

10 years ago

It really depends on when you set those variables. If you set them in an event which only runs when a page is not cached, then it will not work after that page is cached. The caching of Twig itself would not impact this.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2951 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago