【问题标题】:CakePHP2 created plugin not found找不到 CakePHP 2 创建插件
【发布时间】:2016-08-11 17:08:32
【问题描述】:

打开页面时出现错误:

找不到插件权限。

错误:发生内部错误。

我在app/Plugin 下创建了具有这种结构的新插件:

绿色代表新创建的文件。

我创建这个插件的方式与所有其他插件的制作方式相同(白色目录)。 我的页面路线是:

Router::connect('/authority', array('plugin'=>'Authority', 'controller' => 'Authority', 'action' => 'index'));

我的routes.php 包括这一行:

CakePlugin::routes();

这是其他一些正在运行的路线的示例:

Router::connect('/login', array('plugin' => 'users','controller' => 'users', 'action' => 'login'));

以下是插件中的一些其他文件:

AuthorityAppController.php

<?php
class AuthorityAppController extends AppController {

}

AuthorityController.php

<?php
class AuthorityController extends AuthorityAppController {

  public function index(){

  }

}

AuthorityAppModel.php

<?php
class AuthorityAppModel extends AppModel {

}

这是我用于激活插件的引导代码行:

bootstrap.php

CakePlugin::loadAll(array( 'routes' => true ));

【问题讨论】:

    标签: cakephp cakephp-2.0 cakephp-2.3 cakephp-2.1


    【解决方案1】:

    问题出在缓存上。我清除了tmp 目录,它现在可以工作了。

    cd app/tmp
    rm -rf *
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-11
      • 2014-09-08
      • 1970-01-01
      • 2012-08-21
      相关资源
      最近更新 更多