/** * Some AJAX validations * * @throws Kohana_Exception */ public function before() { parent::before(); // Only works in XmlHttpRequest if ($this->validate_xhr === true && !$this->request->is_ajax()) { $this->response->status(400); } }
/** * Setup View with Twig library */ public function before() { parent::before(); if ($this->auto_render === true) { // The view is handle by Twig $this->view = new Twig(); } // Common meta tags Document::meta('charset', array('charset' => 'utf-8')); Document::meta('viewport', array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, minimum-scale=1')); }