问题
We got the error in cakephp 1.3.6. version.No idea why and how, please give your advice or solution.
error: Class 'AppController' not found....... in cakephp 1.3.6.
Thanks
Ajay
回答1:
In your controller class , use at the top as 1st statement
App::uses('AppController', 'Controller');
Because you are extending AppController , so you first need to import it.Like below.
App::uses('AppController', 'Controller');
class CoursesController extends AppController {/*Your code*/ }
回答2:
Just in case this helps anyone. For me it was a misplaced semicolon in a Cakephp find method which was written in the AppController itself. Cakephp went absolutely crazy and threw this weird error which made no sense. Here's the WRONG CODE which was causing the issue for me, notice the semicolon in the conditions array which was a typo on my part.
$user_data = $this->User->find(
'first',
array(
'conditions' => array(
'User.cookie' => $cookie_val;
)
)
);
来源:https://stackoverflow.com/questions/28208551/fatal-error-class-appcontroller-not-found