Last active
August 29, 2015 14:15
-
-
Save oh-sky/4ce9aba4ece1142abaa8 to your computer and use it in GitHub Desktop.
CakePHP2 defined methods of Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App::uses('Controller', 'Controller'); | |
AppController extends Controller { | |
public function __construct($request = null, $response = null) { | |
parent::__construct($request, $response); | |
// ここに書いた処理はComponent初期化より前に実行されます | |
} | |
public function startupProcess() { | |
// ここに書いた処理はComponent初期化より前に実行されます | |
// 親クラス(Controller)のstartupProcess()より前に書く必要があります。 | |
parent::startupProcess(); | |
} | |
public function beforeFilter() { | |
parent::beforeFilter(); | |
// この中の処理はComponent初期化後に実行されます | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment