Exemplo n.º 1
0
 protected function getTemplate()
 {
     if ($this->template === null) {
         $prefix = waSystem::getInstance()->getConfig()->getPrefix();
         $template = substr(get_class($this), strlen($prefix), -6);
         return 'templates/layouts/' . $template . $this->view->getPostfix();
     } else {
         if (strpbrk($this->template, '/:') !== false) {
             return $this->template;
         }
         return 'templates/layouts/' . $this->template . $this->view->getPostfix();
     }
 }
 protected function getTemplate()
 {
     if ($this->template === null) {
         $prefix = waSystem::getInstance()->getConfig()->getPrefix();
         $template = substr(get_class($this), strlen($prefix), -6);
         if (strpos($template, 'Plugin') !== false) {
             $plugin_root = $this->getPluginRoot();
             if ($plugin_root) {
                 $template = preg_replace("~^.*Plugin~", '', $template);
                 return $plugin_root . 'templates/layouts/' . $template . $this->view->getPostfix();
             }
         }
         return 'templates/layouts/' . $template . $this->view->getPostfix();
     } else {
         if (strpbrk($this->template, '/:') !== false) {
             return $this->template;
         }
         return 'templates/layouts/' . $this->template . $this->view->getPostfix();
     }
 }
Exemplo n.º 3
0
 protected function getTemplate()
 {
     if ($this->template === null) {
         $template = ucfirst($this->action);
     } else {
         $template = $this->template;
     }
     $pluginRoot = $this->getPluginRoot();
     $match = array();
     preg_match("/[A-Z][^A-Z]+/", get_class($this), $match);
     $template = $pluginRoot . $this->template_folder . strtolower($match[0]) . "/" . $match[0] . $template . $this->view->getPostfix();
     return $template;
 }
Exemplo n.º 4
0
 protected function getTemplate()
 {
     if ($this->template === null) {
         $template = ucfirst($this->action);
     } else {
         // If path contains / or : then it's a full path to template
         if (strpbrk($this->template, '/:') !== false) {
             return $this->template;
         }
         // otherwise it's a template name and we need to figure out its directory
         $template = $this->template;
     }
     $pluginRoot = $this->getPluginRoot();
     $match = array();
     preg_match("/[A-Z][^A-Z]+/", get_class($this), $match);
     $template = $pluginRoot . $this->template_folder . strtolower($match[0]) . "/" . $match[0] . $template . $this->view->getPostfix();
     return $template;
 }