-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Reconfigure twig paths when they are updated #14781
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
Conversation
Not sure, but does |
I think so, but don't know which version to put there |
I'd go for ~2.8, which is the first version that will contain the new resource. |
*/ | ||
public function __toString() | ||
{ | ||
return (string) $this->resource; |
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.
You can do the string casting in the constructor already.
👍 |
Any other suggestion / improvement ? |
@@ -74,23 +75,30 @@ public function load(array $configs, ContainerBuilder $container) | |||
} else { | |||
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace)); | |||
} | |||
$container->addResource(new FileExistenceResource($path)); |
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.
not needed here as we don't change the container configuration based on the existence of this folder
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.
Thanks for the hint
https://github.com/symfony/symfony/pull/14781/files#r31505368 not needed here as we don't change the container configuration based on the existence of this folder
👍 |
Thank you @chbruyand. |
Refresh twig paths upon creation and deletion. As we don't care neither about path's modification time nor path's content, a new Resource has been added in the Config Component.
Full discussion in #14778.