예제 #1
0
파일: Ajax.php 프로젝트: NegoCore/core
 /**
  * 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);
     }
 }
예제 #2
0
파일: Template.php 프로젝트: NegoCore/core
 /**
  * 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'));
 }