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
 /**
  * Loads the template [View] object.
  */
 public function before()
 {
     parent::before();
     if ($this->auto_render === true) {
         $this->template = View::factory($this->template);
         $action = $this->request->action() == 'filter' ? 'list' : $this->request->action();
         $this->view = mb_strtolower(Request::get('directory')) . '/' . Request::get('controller') . '/v_' . $action;
         $this->form = mb_strtolower(Request::get('directory')) . '/' . Request::get('controller') . '/v_form';
         $this->template->bind_global('config', $this->config);
         $this->template->bind_global('language', $this->language);
         $this->template->bind_global('user', $this->user);
         $this->template->bind_global('is_admin', $this->is_admin);
     }
 }