In my CakePHP 2 application, I have a problem with beforeFilter. In this thread he worked well. Due to the old version of CakePHP.
In my code, if the user is not authorized, I want to show him "anotherview.ctp". I do not want to redirect the visitor to another page. (due to issues with adsense)
When I use "this-> render" in beforeFilter, the code in my "pointer" also runs. I want to stop execution after the last line of "beforeFilter". When I add "exit ()" to beforeFilter, it broke my code.
How to stop execution in beforeFilter without breaking the code?
class MyController extends AppController { function beforeFilter() { if ( $authorization == false ) { $this->render('anotherview');
source share