예제 #1
0
파일: Widget.php 프로젝트: eok8177/shopCMS
 /**
  * Before action
  */
 public function before()
 {
     parent::before();
     if (Request::$initial === Request::$current) {
         throw new HTTP_Exception_404();
     }
 }
예제 #2
0
파일: Ajax.php 프로젝트: eok8177/shopCMS
 /**
  * Before action
  */
 public function before()
 {
     parent::before();
     // If not ajax request
     if (!$this->request->is_ajax()) {
         // Error 404
         throw new HTTP_Exception_404();
     }
 }
예제 #3
0
파일: Module.php 프로젝트: NegoCore/core
 /**
  * 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);
 }
예제 #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();
 }