我的控制器是/src/AppBundle/Controller/TestsController.php,类是:
class TestsController extends Controller
{
/**
* @Route("/tests/index", name="testsIndex")
*/
public function indexAction(Request $request)
{
return $this->render('AppBundle::tests\index.html.twig', [
'text' => "Hello world"
]);
}
}
我的观点是/src/AppBundle/Resources/views/tests/index.html.twig并包含:
{{text}}
无法找到模板“AppBundle :: tests / index.html.twig”(查看:D:\ www \ project \ app / Resources / views,D:\ www \ project \ vendor \ symfony \ symfony \ src \ Symfony \桥\嫩枝/资源/视图/表) .
我跟着这个线程,哪个错误几乎相同,但仍然找不到错误 . 这让我疯了 .
谢谢!