Example #1
0
 public function template_partial()
 {
     $controller = $this->routed_controller ? $this->routed_controller : $this->data->controller;
     $view = new Template();
     $view->add_path(VIEW_DIR . $controller . "/" . $this->path);
     $view->add_path(VIEW_DIR . $this->path);
     foreach ($this->data->template_paths as $pathdir) {
         $view->add_path(substr($pathdir, 0, strrpos($pathdir, "/")) . "/" . $this->path);
     }
     if (property_exists($this, "data")) {
         foreach ($this->data as $var => $val) {
             if (!$view->{$var}) {
                 $view->{$var} = $val;
             }
         }
     }
     $this->output = $view->parse($this->format, "partial");
 }