Skip to content

"Request scope" in Craft/Yii? #12951

Closed Answered by brandonkelly
wsydney76 asked this question in Q&A
Discussion options

You must be logged in to vote

Ended up taking a different approach. Craft 4.5 is going to introduce a new _globals global Twig variable, which is set to a collection, and be used to store globally-scoped values across all your templates. (#13050)

{% do _globals.set('copyright', image.copyright) %}
---
{{ _globals.get('copyright') }}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants