Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why CakePHP 2.0 is not using my AppController?

Tags:

cakephp-2.0

I have just upgraded to Cakephp 2.0 alpha, and immediately faced a problem. The app_controller.php in the app/ folder is not loaded in my controllers. Instead controllers use the CakePHP own AppController.php in the lib/Cake/Controller/AppController.php.

I have tried renaming the app_controller to AppController.php aswell but its not working. I have tried deleting the whole file and then copying the lib/Cake/Controller/AppController.php file and then editing it but not working.

I have also tried deleting cache files.

I just simply use:

class AppController extends Controller {
    public function beforeFilter() {
        die;
    }
}

And the application wont die.

My controller is also simply just:

class NewsController extends AppController {
    function beforeFilter() {
        parent::beforeFilter();
    }
    function index() {
    }
}

So what I could be doing wrong? Im also using Windows 7 + Netbeans with Subversion to update project (if that has anything to do with it :p).

like image 306
Pehmolelu Avatar asked Jun 21 '11 16:06

Pehmolelu


1 Answers

Did much of searching and didn't look from most obvious place: Github cakephp docs: https://github.com/cakephp/docs/blob/master/en/controllers.rst . I thought they were still 1.3 docs but it appears they are updated. Since they are now updated, it says that I should put the old app_controller.php into Controller folder and camel case it to AppController.php.

like image 101
Pehmolelu Avatar answered Sep 21 '22 12:09

Pehmolelu