我已经使用composer安装了Bootstrap-UI插件,并将该插件加载到bootstrap.php中。
当我向ViewApp.php添加必要的代码时,我收到错误。
Strict (2048): Declaration of App\View\AppView::initialize() should be compatible with Cake\View\View::initialize() [APP/View/AppView.php, line 22]
Code Context
*/
class AppView extends View
{
我添加的代码是:
class AppView extends View
{
public $layout = 'BootstrapUI.default';
public function initialize(array $config)
{
$this->loadHelper('Html', ['className' => 'BootstrapUI.Html']);
$this->loadHelper('Form', ['className' => 'BootstrapUI.Form']);
$this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']);
$this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
}
答案 0 :(得分:1)
我遇到了同样的问题,我删除了'数组$ config'在初始化函数中。
public function initialize()
{
// Code from Plugin
}
您还需要在视图中添加<?php $this->extend('../Layout/TwitterBootstrap/dashboard'); ?>
以获得引导程序外观。