Cake3, beforeFilterでredirectが効かない時があるっぽい
<?php namespace App\Controller; class PostsController extends AppController { public function beforeFilter(Event $event) { parent::beforeFilter($event); $this->forceRedirectToStep1(); } public function step1() { } public function step2() { exit; } private function forceRedirectToStep1() { if ($this->getParam('action') != 'step1') { $this->redirect(['action' => 'step1']); } } }
step2() で exit を書いてたら動かなかった