Exemple #1
0
 /**
  * Compiles a template using the file located at $path
  * @param  string $path
  * @return string
  */
 public function loadTemplate($path)
 {
     $tpl = new Template();
     $tpl->injectVariables($this->getVariables());
     $tpl->setViewName($path);
     $tpl->setConfig("allow_debug", $this->getConfig("allow_debug"));
     $tpl->setConfig("layout", $this->getConfig("layout"));
     return $tpl->compile();
 }
 /**
  * Renders a templated view file
  * @param  string $filename
  * @param  array  $variables
  * @param  string $extension Defaults to .php
  */
 protected function render($filename, $variables = array(), $extension = '.php')
 {
     $filename = $this->getTemplatePath() . $filename . $extension;
     $this->view->render(array("content" => Template::parseFile($filename, $this->view->getVariables())));
 }
 protected function render($filename, $variables = array(), $extension = '.php')
 {
     $path = implode(DIRECTORY_SEPARATOR, array_merge(array($this->adaptor->getAdminViewPath()), $this->viewPathExtra));
     $filename = $path . DIRECTORY_SEPARATOR . $filename . $extension;
     $this->view->render(array("content" => Template::parseFile($filename, $this->view->getVariables())));
 }
 public function widget($args, $instance)
 {
     echo Template::parseFile($this->getTemplateSource(), array("polyglot" => Polyglot::instance(), "pluginSetup" => $args, "config" => $instance));
 }