【发布时间】:2018-07-16 11:11:18
【问题描述】:
通过编辑config/packages/framework.yaml启用php引擎后,我现在面临“模板:::/test/test.html.php”不退出”错误!!
控制器:
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class TestController extends Controller
{
/**
* @Route("/test.html.php", name="testphp")
*/
public function testphp(){
return $this->render('test/test.html.php');
}
}
路径:Templates/test/test.html.php
【问题讨论】:
-
我们能看到你的文件树吗?
-
你确定不是 test/test.html.twig
-
附带说明:您的路线不必具有扩展名(或者甚至是相同的名称!)。你可以简单地拥有
* @Route("/test", name="testphp") -
感谢您的评论!