-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TwigBundle] Warmup twig templates in non-standard paths #14764
Conversation
kbond
commented
May 27, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #12507 |
License | MIT |
Doc PR | symfony/symfony-docs#5391 |
@@ -78,6 +78,8 @@ public function load(array $configs, ContainerBuilder $container) | |||
$container->addResource(new DirectoryResource($path)); | |||
} | |||
|
|||
$container->setParameter('twig.paths', $config['paths']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not create parameters for such things. Instead, you need to inject the value directly via replaceArgument
and add a comment in the XML about the value that is going to be injected (have a look at some other examples in the framework).
Those changes were made. |
@@ -27,14 +29,16 @@ class TemplateCacheCacheWarmer implements CacheWarmerInterface | |||
{ | |||
protected $container; | |||
protected $finder; | |||
protected $paths; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could it be private actually ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I typically would make it private but was following the convention of the file. Should I make it private then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please. Any new property should start as being private. We only switch to protected when we decide it should be a supported extension point (and I have no idea why we made the other properties protected btw, but changing it is a BC break)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. This change was made.
Any chance this can make it into 2.7? |
@kbond we don't accept new features in 2.7 anymore. It'll be released in few days. |
@kbond Can you rebase on current 2.7 and fix the small CS issue? |
Done. |
👍 |
👍 (though I would rename |
Thank you @kbond. |
…paced twig templates (kbond) This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Templating] Add note about cache warming namespaced twig templates | Q | A | ------------- | --- | Doc fix? | yes | New docs? | symfony/symfony#14764 | Applies to | 2.3 | Fixed tickets | #5391 Commits ------- cbd86ce add note about cache warming