Tuesday, July 3, 2012

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

Just change last line of APP/webroot/index.php and call dispatcher with your custom request class.

#APP/Lib/Network/AppRequest.php
App::uses('CakeRequest', 'Network');
class AppRequest extends CakeRequest {
...
}

#APP/webroot/index.php
...
App::uses('AppRequest', 'Network');
$Dispatcher->dispatch(new AppRequest(), ...

Read this http://book.cakephp.org/2.0/en/controllers/request-response.html#changing-the-response-class

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: