Replies: 1 comment 3 replies
-
I am not sure to be convinced. If a particular inclusion requires the presence of "global context" variables to function properly, perhaps it's an indication that this included template shouldn't be isolated in the first place. 🤷♂️ In my view, complicating the process of setting context variables only to accommodate isolated inclusions doesn't seem justified. Especially considering that the defaults of the Marten framework are (i) no strict variables and (ii) no isolated inclusions. I don't think it's warranted to introduce this level of complexity to all the users of the framework given that most of those will simply use the defaults, which are simple enough and work for most cases. To me, the solution to what you are describing would be to use contextual inclusions. |
Beta Was this translation helpful? Give feedback.
-
With
isolated_inclusions
enabled, it's tedious to pass some variables around, e.g. CSRF token. I recommend adding aglobal_context
which is similar tocontext
, but it is available everywhere, regardless of whether isolated inclusions are enabled or disabled. Context producers should put the produced values there, and it should be available to handlers too, in a similar way ascontext
.Beta Was this translation helpful? Give feedback.
All reactions