未找到 CakePHP2 创建的插件
CakePHP2 created plugin not found
打开页面时出现错误:
Plugin Authority could not be found.
Error: An Internal Error Has Occurred.
我在 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 行激活插件的代码:
bootstrap.php
CakePlugin::loadAll(array( 'routes' => true ));
问题出在缓存上。我清除了 tmp
目录,现在可以使用了。
cd app/tmp
rm -rf *
打开页面时出现错误:
Plugin Authority could not be found.
Error: An Internal Error Has Occurred.
我在 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 行激活插件的代码:
bootstrap.php
CakePlugin::loadAll(array( 'routes' => true ));
问题出在缓存上。我清除了 tmp
目录,现在可以使用了。
cd app/tmp
rm -rf *