title: Cakephp 3 redirect in beforeFilter of parent class
body: <p>In our CakePHP 3 application we found a different behaviour. We're sure that it worked well in CakePHP 2, so I suppose something changed in new version.</p>
  
  <p>When user visits this url: <code>/b2controller/myMethod</code>, these methods run:  </p>
  
  <pre><code>AppController::beforeFilter()  
  BController::beforeFilter()  
  B2Controller::beforeFilter()  
  B2Controller::myMethod()  
  B2Controller::myMethod2()    
  </code></pre>
  
  <p>then user is redirected to this url <code>/ccontroller/myMethod10/</code>   </p>
  
  <p>But we need this:   </p>
  
  <p>When user visits 
  <code>/b2controller/myMethod</code> and <code>$isOk</code> condition is <code>true</code>, then redirect user to <code>/ccontroller/myMethod10/</code>, without running <code>BController::beforeFilter()</code>, <code>B2Controller::beforeFilter()</code>, <code>B2Controller::myMethod()</code> and <code>BController::MyMethod2()</code>.</p>
  
  <p>Our minimal code is like this:</p>
  
  <pre><code>class AppController {
    function beforeFilter(Event $event) {
          // set $isOk variable
          if ($isOk == TRUE) {
             return $this-&gt;redirect('/ccontroller/myMethod10/');
          }
          $aa=1;
          $ab=2;
    }
  }
  
  class BController extends AppController {
    function beforeFilter(Event $event) {
      parent::beforeFilter($event);
  
      $a=1;
      $b=2;
    }
  
    function myOtherMethod() {
        myOtherMethod2();
    }
  
    function myOtherMethod2() {
        ...
        ...
    }
  }
  
  class B2Controller extends BController {
    function beforeFilter(Event $event) {
      parent::beforeFilter($event);
  
      $m1=1;
      $m2=2;
    }
  
    function myMethod() {
        myMethod2();
    }
  
    function myMethod2() {
        ...
        ...
    }
  }
  
  class CController extends AppController {
    function beforeFilter(Event $event) {
      parent::beforeFilter($event);
    }
  
    function myMethod10() {
        ...
        ...
        ...
    }
  }
  </code></pre>
  
  <p>How can I make user to redirect to another controller action, from the beforeFilter of main class ? Note that redirect occurs. But user is redirected after calling <code>myMethod()</code> and <code>myMethod2()</code>.</p>
  
  <p>Also note that there is other controllers like <code>CController</code> that uses beforeFilter redirect behaviour.</p>