Reputation: 15474
I need to load controller class and I try:
App::import('Controller','AppController');
or
App::import('Controller','PagesController');
But this every time returns false. When I try this:
App::import('Model','AppModel');
it returns true, so it seems it's not working for controllers - why?
Upvotes: 0
Views: 2965
Reputation: 3415
When using App::import(type, name)
for a controller, you don't need to include "Controller" in the name you import, just when creating the instance variable.
App::import('Controller', 'Pages');
$Pages = new PagesController;
Upvotes: 3