Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コントローラーの 1 つに ajax 呼び出しを行っています。しかし、呼び出しを行うたびに init() が実行されます (これが init() の仕組みです)。init() の実行を無効にする方法はありますか?
最も簡単な方法は、それがinit内のAjaxリクエストであるかどうかを確認することです。
public function init() { if (!$this->getRequest()->isXmlHttpRequest()) { // init code here } }