简体   繁体   English

无法找到模板symfony3

[英]Unable to find template symfony3

I'm doing a project as a web dev student on symfony3. 我正在做一个关于symfony3的web开发学生的项目。 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) 无法找到模板“ForoBundle:Usuario:prueba.html.twig”(查看:D:\\ xampp \\ htdocs \\ dawSymfony \\ app / Resources / views,D:\\ xampp \\ htdocs \\ dawSymfony \\ vendor \\ symfony \\ symfony \\ src \\的Symfony \\桥\\嫩枝/资源/视图/表)

I dont get it, can you help me out? 我不明白,你能救我​​吗?

My routes: 我的路线:

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


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

My action: 我的行动:

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

}

Structure 结构体

Your code should look like that: 您的代码应如下所示:

$this->render("@Foro/Usuario/prueba.html.twig");

Check the doc . 检查文档

You should be using slashes and bundle name without word "Bundle". 你应该使用斜杠和捆绑名称,而不是单词“Bundle”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM