I'm using CakePHP 2.3. and I'm trying to cache my home page view. But After caching it to home.php, I can't load cached view because of error:
Error: Class 'AuthComponent' not found
File: C:\wamp\www\project\trunk\app\tmp\cache\views\home.php
Line: 87
I use AuthComponent for realizing if user is logged in or not. Without caching Everything works.
Controller code:
public $helpers = array('Cache');
public $cacheAction = array(
'home' => '60 minutes',
);
Thanks
App::uses() your Auth component in your bootstrap would help:
App::uses('AuthComponent', 'Controller/Component');
This way Cake knows where to load the class from if its needed (even in cache mode).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With