I have been moving my application from Symfony 3 to Symfony 4 with Flex, but that gives me the error
Template reference "ComurImageBundle:Form:croppable_image_modal.html.twig" not found, did you mean "@ComurImage/Form/croppable_image_modal.html.twig"?
The stack trace shows this coming from my template
{{ form_start(form) }}
Doing some digging, the offending line is actually in comur\image-bundle\DependencyInjection\Compiler\FormPass.php
If, as suggested, I change the line
$template = "ComurImageBundle:Form:croppable_image_modal.html.twig";
to
$template = "@ComurImage/Form/croppable_image_modal.html.twig";
then the problem seems to be solved.
Reviewing the documentation I can see that the first syntax is recommended for 3.1
https://symfony.com/doc/3.1/templating.html#referencing-templates-in-a-bundle
The later syntax is recommended for 3.2 to master (which is 5.1 as I write this)
https://symfony.com/doc/3.2/templating.html#referencing-templates-in-a-bundle
https://symfony.com/doc/master/templates.html#bundle-templates
I'm going to work on a PR to change to the newer syntax. Minimum supported version is already 3.4, so breaking compatibility with 3.1 should not be an issue.
I have been moving my application from Symfony 3 to Symfony 4 with Flex, but that gives me the error
The stack trace shows this coming from my template
{{ form_start(form) }}Doing some digging, the offending line is actually in comur\image-bundle\DependencyInjection\Compiler\FormPass.php
If, as suggested, I change the line
$template = "ComurImageBundle:Form:croppable_image_modal.html.twig";to
$template = "@ComurImage/Form/croppable_image_modal.html.twig";then the problem seems to be solved.
Reviewing the documentation I can see that the first syntax is recommended for 3.1
https://symfony.com/doc/3.1/templating.html#referencing-templates-in-a-bundle
The later syntax is recommended for 3.2 to master (which is 5.1 as I write this)
https://symfony.com/doc/3.2/templating.html#referencing-templates-in-a-bundle
https://symfony.com/doc/master/templates.html#bundle-templates
I'm going to work on a PR to change to the newer syntax. Minimum supported version is already 3.4, so breaking compatibility with 3.1 should not be an issue.