/** * BeforeFilter * * @param \Cake\Event\Event $event Event instance. * @return void * @throws Cake\Network\Exception\NotFoundException */ public function beforeFilter(Event $event) { // set cakebox version $this->set(['version' => $this->Info->cakeboxVersion()]); // Throw 404's for non-ajax connections to ajax_ prefixed actions if (substr($this->request->action, 0, 5) == 'ajax_') { if (!$this->request->is('ajax')) { throw new NotFoundException(); } } }