Ejemplo n.º 1
0
 /**
  * @return mixed
  */
 public function formatTemplateFiles()
 {
     $name = $this->getName();
     $templateFiles = [];
     $presenter = substr($name, strrpos(':' . $name, ':'));
     $dir = dirname($_SERVER['SCRIPT_NAME']);
     if (file_exists($_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $this->getView() . '.latte')) {
         $templateFiles[] = $_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $this->getView() . '.latte';
     }
     if (file_exists($_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $presenter . '/' . $this->getView() . '.latte')) {
         $templateFiles[] = $_SERVER['DOCUMENT_ROOT'] . $dir . '/themes/' . $this->settings['theme'] . '/' . $presenter . '/' . $this->getView() . '.latte';
     }
     $originalTemplateFiles = parent::formatTemplateFiles();
     return array_merge($templateFiles, $originalTemplateFiles);
 }
Ejemplo n.º 2
0
 public function formatTemplateFiles()
 {
     $list = parent::formatTemplateFiles();
     $list[] = dirname($this->getReflection()->getFileName()) . "/templates/{$this->view}.latte";
     return $list;
 }
Ejemplo n.º 3
0
 public function formatTemplateFiles() : Ytnuk\Templating\Template
 {
     return $this['templating'][$this->getView()] ?: parent::formatTemplateFiles();
 }
Ejemplo n.º 4
0
 /**
  * Formats view template file names
  *
  * @return array
  */
 public function formatTemplateFiles()
 {
     return array_unique(array_merge($this->getTemplateFilesFormatter()->formatTemplateFiles($this->getName(), $this->getView()), parent::formatTemplateFiles()));
 }