Shawn Northrop
Shawn Northrop

Reputation: 6016

Symfony2 Twig loading templates

I am having some trouble telling twig which template to load.

I have a file located in MyBundle/Resources/Views/Admin/Project/list.html.twig

When I declare: return 'MyBundle:Admin:Project:list.html.twig' I get the following error:

Unable to find template 

If I move the file out of the Project directory i.e. MyBundle/Admin/list.html.twig and declare: return 'MyBundle:Admin:list.html.twig' the template is rendered. Am I missing something?

Thanks!

Upvotes: 1

Views: 2239

Answers (1)

sensorario
sensorario

Reputation: 21620

Try this:

MyBundle:Admin:Project/list.html.twig

Upvotes: 5

Related Questions