/** * AppController::beforeRender() * * @return void */ public function beforeRender() { if ($this->request->is('ajax') && $this->layout === 'default') { $this->layout = 'ajax'; } # default title if (empty($this->pageTitle)) { $this->pageTitle = __(Inflector::humanize($this->request->action)) . ' | ' . __($this->name); } $this->set('title_for_layout', $this->pageTitle); $this->disableCache(); if ($m = $this->Session->read('Message.auth')) { $this->Flash->message($m['message'], 'error'); $this->Session->delete('Message.auth'); } parent::beforeRender(); }