Beispiel #1
0
 /**
  * Before action
  */
 public function before()
 {
     parent::before();
     if (Request::$initial === Request::$current) {
         throw new HTTP_Exception_404();
     }
 }
Beispiel #2
0
 /**
  * Before action
  */
 public function before()
 {
     parent::before();
     // If not ajax request
     if (!$this->request->is_ajax()) {
         // Error 404
         throw new HTTP_Exception_404();
     }
 }
Beispiel #3
0
 /**
  * Before get module's directory
  */
 public function before()
 {
     parent::before();
     // Get module's directory
     $class = new ReflectionClass(get_called_class());
     $module_path = explode(DIRECTORY_SEPARATOR . 'classes', $class->getFileName());
     $module_path = explode(DIRECTORY_SEPARATOR, $module_path[0]);
     // Module directory name
     $this->_module_name = end($module_path);
 }
Beispiel #4
0
 /**
  * Assigns the template [View] as the request response.
  */
 public function after()
 {
     if ($this->auto_render === true) {
         $this->template->set_global('request', Request::get());
         $this->template->set_global('modules', $this->cms_modules);
         $this->template->set_global('module', $this->curr_module);
         $this->template->title = $this->_get_title();
         $this->template->keywords = $this->keywords ?: Config::get('home.meta_k');
         $this->template->description = $this->description ?: Config::get('home.meta_d');
         $this->template->content = $this->content;
         if (Kohana::$environment === Kohana::DEVELOPMENT) {
             $v_profiler = View::factory('profiler/stats');
         }
         $this->template->bind_global('v_profiler', $v_profiler);
         $this->response->body($this->template->render());
     }
     parent::after();
 }