草庐IT

setTemplate

全部标签

php - 在 Symfony ( PHP ) 中,setTemplate 方法的路径是什么?

我在模块XYZ的Action类中使用以下代码:$this->setTemplate("abc.php");它试图在哪个目录中查找abc.php? 最佳答案 对应的路径是templates目录,与编辑actions.class.php文件的actions目录并列.在文件/path/to/my/module/actions/actions.class.php中,如果您这样做:$this->setTemplate("index");相应的模板文件位于:/path/to/my/module/templates/indexSuccess.ph