【发布时间】:2017-11-16 06:40:45
【问题描述】:
我写了一个 CakePHP 插件https://github.com/anuj9196/CakePHP-App-Installer
插件使用来自plugin_path/src/template/layout/default.ctp的default.ctp布局
当宿主应用程序中使用了其他主题时。就像在我的情况下,我在AppController 的beforeRender() 中设置了一个
$this->viewBuilder()->setTheme('DashboardTemplate');
DashboardTemplate 在应用程序的/plugin/ 目录中。
现在,当我使用 example.com/installer/install 访问插件的 URL 时
模板加载在DashboardTemplate 主题之上。
如何在插件的 AppController 中禁用它们?
插件目录内的AppController包含
<?php
namespace Installer\Controller;
use App\Controller\AppController as BaseController;
class AppController extends BaseController
{
// nothing here
}
【问题讨论】:
标签: cakephp cakephp-3.4