示例#1
0
 public function __construct()
 {
     parent::__construct();
     /**
      * If no title is set, create a generic title based off of the view's name.
      */
     if (empty($this->view->title)) {
         $title = ucwords($this->front->getView());
         Pixelpost_Plugin::executeFilter('filter_title', $title);
         $this->view->title = $title;
     }
 }
示例#2
0
 public function __destruct()
 {
     /**
      * Run the default site-wide filters
      * 
      * Make a copy of the options we are going to filter, 
      * to make sure that the filters only change the view, not the actual config.
      */
     $site_name = $this->config->site_name;
     $site_description = $this->config->site_description;
     Pixelpost_Plugin::executeFilter('filter_site_name', $site_name);
     Pixelpost_Plugin::executeFilter('filter_site_description', $site_description);
     $this->view->site_name = $site_name;
     $this->view->site_description = $site_description;
     /**
      * Load the view, either from the controller view, or from the template's view file
      * 
      * @todo this complex if statement should be moved to a method, or some place out of the way.
      */
     if ($viewPath = $this->viewLoader()) {
         $this->content = $this->view->fetch($viewPath);
     } else {
         /**
          * No matching View exists, display a 404 error.
          * @todo Use a Ultralite specific Exception class
          */
         throw new Pixelpost_Exception('File Not Found', 404);
     }
     if (!is_null($this->content)) {
         $this->view->content = $this->content;
         /**
          * If no layout is specified, only show the view file
          * Otherwise load the view inside the layout.
          */
         if (empty($this->layout)) {
             $result =& $this->content;
         } else {
             $result = $this->view->fetch(THMPATH . '/' . $this->config->theme . '/' . $this->layout);
         }
         $this->front->setBody($result);
     }
 }