2011-12-29 46 views
3

我試圖從app/Resources/views目錄中導入一些宏,但Symfony似乎沒有找到該模板。從應用程序目錄中導入宏模板

我試過以下方法,它們全都返回錯誤Unable to find template

{% import '::macros.twig' as macros %} 
{% import '/app/Resources/views/macros.twig' as macros %} 
{% import '/app/Resources/views/macros.twig' as macros %} 

如何從app/Resources/views導入宏?

回答

8

我想通了。文件名必須有一個擴展名.html.twig才能工作。