global variables


I am trying to figure out the best way to mutualise a value throughout a site, minimising identical queries on every page load and using this variable in differnet views.

Here’s my use case :

I have an sql count, which will be shown in the menu view(always rendered)

and many other views that might show/use this same value.

as it will be constantly be shown in the menu it will be evaluated every page load.


I would use the session to save that count value.

Consider creating a widget