Reputation: 619
I've recently started to learn Symfony2, based on a job opportunity. I've got some of the basics down, but I'm strugging with the @template() section of annotation routing.
I've been able to use annotations to route the right url to the right controller method, but the template I put in @template() never seem to work.
Basically, what I'm after is an explanation of what goes into it. I've seen in the official documentation:
@Template("SensioBlogBundle:Post:show.html.twig")
But I don't understand what that param is. I get the ending part is literally a filename, but what are the first two components separated by colons? I've tried a bunch of different things to try and understand, but I haven't been able to make it connect to a new template file I've placed in views/main/index.html.twig of my bundle's resources. I've tried
@Template("BlogBundle:main:index.html.twig")
With no success. (BlogBundle is the folder all my code resides in, within my bundle)
The rest of the documentation seems to make sense, it's just this one param never seems to get a good explanation.
Thank you.
Upvotes: 2
Views: 180
Reputation: 29912
SensioBlogBundle:Post:show.html.twig
mean this path: src/Sensio/BlogBundle/Resources/views/Post/show.html.twig
The bundle:controller:view
is Symfony2 standard notation and, in case of template or render of views, have to be interpretated as I explain.
Upvotes: 2