Symfony template referencing

时间:2016-07-28 20:28:37

标签: php symfony twig

I have a Twig template in this folder structure

appName
   app
     resources
        FosUserBundle
                 views
                    myTemplate.html.twig
        views
          Form
            templateToRefer.html.twig

from -myTemplate.html.twig- I would like to reference -templateToRefer.html.twig- that is inside folder views that is brother of FosUserBundle folder. Is there any way to do it?

My way is this

{% form_theme form 'Form/fields.html.twig' %}

but I always get error

Unable to find template "Form/fields.html.twig" (looked into: /home/felpone/Scrivania/appName/app/Resources/views

1 个答案:

答案 0 :(得分:1)

你需要传递完整路径'AppBundle:Form:templateToRefer.html.twig'

相关问题