-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] [Form] Problem with twig warmer and form templates #21322
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
Comments
Couldn't we do that in the extension? And shouldn't we also add the paths discovered from other bundles here too? |
I tried to do that in the extension and it works, but I want to keep warming the templates only if the |
After compilation absolutely all template paths are defined in My point is, shouldn't it be better iterate over the Twig loader paths instead of hardcoding again all possible paths here? (see #27764 where the new default path has been forgotten) symfony/src/Symfony/Bundle/TwigBundle/TemplateIterator.php Lines 50 to 66 in ea0b508
Specifically, this is what I'm talking about: // ...
$loader = $this->twig->getLoader();
if (!$loader instanceof FilesystemLoader) {
return;
}
foreach ($loader->getNamespaces() as $namespace) {
foreach ($loader->getPaths($namespace) as $path) {
$this->templates = array_merge($this->templates, $this->findTemplatesInDirectory($path, $namespace));
}
}
// ... so we don't have to keep this dependency ( symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php Lines 87 to 88 in ea0b508
symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php Lines 50 to 53 in cccb66f
WDYT? |
@yceruto I forgot about this issue, thanks for reminding me. I think refactoring is not subject of this bug issue. You should create a new one. |
I check this bug again and @weaverryan fixed it in the commit 2ef619f, thanks for fix |
Twig warmer doesn't warm up templates for the form component. We use read-only file system on production and we have problem with the missing templates.
The form templates are in non-standard path:
src/Symfony/Bridge/Twig/Resources/views/Form
I try fix it somehow but I need some code review or discussion about it: master...twoleds:twig-form-warming
The text was updated successfully, but these errors were encountered: