【发布时间】:2016-08-26 11:10:32
【问题描述】:
我正在使用带有多个全局插件的 CakePHP。我想使用应用程序本地的控制器从我的一个插件中呈现一个元素。
APP/Controller/CustomreportController.php里面
$this->render('COPlugin.Elements/reportdates');
当我尝试查看页面时,我收到以下错误:
缺少视图错误:CustomreportController::paapprovals() 的视图 没找到。
错误:确认您已创建文件: APP/View/Plugin/COPlugin/Elements/reportdates.ctp
所以你看,它希望我在 APP 本身内部创建一个视图:View/Plugin/COPlugin/Elements,而不是使用我已经拥有的视图:ROOT/plugins/COPlugin/View/Elements/reportdates。 ctp。
如何渲染插件中已经存在的元素?
【问题讨论】:
标签: cakephp