Search code examples
cakephpcakephp-2.0cakephp-2.3cakephp-2.1

CakePHP2 created plugin not found


When open page I get error:

Plugin Authority could not be found.

Error: An Internal Error Has Occurred.

I created new plugin under app/Plugin with this structure:

enter image description here

Green color represents newly created files.

I created this plugin the same way all other plugins are made (white directories). My route to page is:

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

My routes.php include this line:

CakePlugin::routes();

This is example of some other route that is working:

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

Here are some other files from the plugin:

AuthorityAppController.php

<?php
class AuthorityAppController extends AppController {

}

AuthorityController.php

<?php
class AuthorityController extends AuthorityAppController {

  public function index(){

  }

}

AuthorityAppModel.php

<?php
class AuthorityAppModel extends AppModel {

}

And this is my bootstrap line of code for activating plugins:

bootstrap.php

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

Solution

  • The issue was with the cache. I cleared tmp directory and it works now.

    cd app/tmp
    rm -rf *