Allow dynamic option change during runtime#217
Open
kevinpapst wants to merge 1 commit intoavanzu:masterfrom
kevinpapst:dynamic-options
Open
Allow dynamic option change during runtime#217kevinpapst wants to merge 1 commit intoavanzu:masterfrom kevinpapst:dynamic-options
kevinpapst wants to merge 1 commit intoavanzu:masterfrom
kevinpapst:dynamic-options
Conversation
using context helper to load body_class options
Contributor
Author
|
That should also fix #206 |
|
When this PR will be merged ? |
Collaborator
|
@craph I have to spent some time to check if really the ContextHelper expect this behaviour in this part, not sure if it is the really use case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @shakaran ,
another PR with two non BC break changes:
The Service alias is required for auto-wiring via constructor annotation.
Using the context helper allows us to change the body class options during runtime.
Use-Case: I added a EventSubscriber that listen on the
kernel.controllereven, which dynamically loads theskinand other options (likeboxed_layout) from a user db. I usedContextHelper->setOption()but the options were not applied in the twig template.Now in works like that (adapted for demo):
Why? Currently in master the Twig helper gets a static copy of the options array, where another copy is injected into the ContextHelper. This builds the internal options from that copy & the user config but doesn't use it (at least not in the TwigExtensions helper).
I believe this is a programmatically bug or I completely misunderstood the ContextHelper?!?