Pablo Ruiz Ortega Pablo Ruiz Ortega - 29 days ago 105
Twig Question

Unable to find template symfony3

I'm doing a project as a web dev student on symfony3.
I've been looking for similar errors, but i cant get the solution for mine.
I have a problem when im trying to load a twig template, the error is the next one:

Unable to find template "ForoBundle:Usuario:prueba.html.twig" (looked into: D:\xampp\htdocs\dawSymfony\app/Resources/views, D:\xampp\htdocs\dawSymfony\vendor\symfony\symfony\src\Symfony\Bridge\Twig/Resources/views/Form)

I dont get it, can you help me out?

My routes:

path: /foro
defaults: { _controller: ForoBundle:Default:index }

path: /prueba
defaults: { _controller: ForoBundle:Default:prueba }

My action:

public function pruebaAction(){
return $this->render("@Foro:Usuario:prueba.html.twig");



Answer Source

Your code should look like that:


Check the doc.

You should be using slashes and bundle name without word "Bundle".