Example #1
0
 public function __toString()
 {
     TemplateEngine::appendPath(Ntentan::getFilePath('lib/views/helpers/lists/templates'));
     $this->rowTemplate = $this->rowTemplate == null ? 'row.tpl.php' : $this->rowTemplate;
     $this->defaultCellTemplate = $this->defaultCellTemplate == null ? 'default_cell.tpl.php' : $this->defaultCellTemplate;
     return TemplateEngine::render('list.tpl.php', array("headers" => $this->headers, "data" => $this->data, "row_template" => $this->rowTemplate, "cell_templates" => $this->cellTemplates, "default_cell_template" => $this->defaultCellTemplate, "variables" => $this->variables, "has_headers" => $this->hasHeaders));
 }
Example #2
0
 public function out($viewData)
 {
     try {
         if ($this->template === false) {
             $data = null;
         } else {
             $data = TemplateEngine::render($this->template, $viewData, $this);
         }
         if ($this->layout !== false && !Ntentan::isAjax()) {
             $viewData['contents'] = $data;
             $output = TemplateEngine::render($this->layout, $viewData, $this);
         } else {
             $output = $data;
         }
     } catch (Exception $e) {
         print "Error!";
     }
     return $output;
 }
Example #3
0
 public function __toString()
 {
     return TemplateEngine::render('wyf_inputs_forms_date.tpl.php', $this->getTemplateVariables());
 }
Example #4
0
 public function __toString()
 {
     $cacheKey = $this->getCacheKey();
     if (Cache::exists($cacheKey) && Ntentan::$debug === false) {
         $output = Cache::get($cacheKey);
     } else {
         $this->execute();
         $this->preRender();
         TemplateEngine::appendPath($this->filePath);
         if ($this->template == "") {
             $this->template = ($this->plugin == '' ? '' : "{$this->plugin}_") . "{$this->name}_widget.tpl.php";
         }
         try {
             $output = TemplateEngine::render($this->template, $this->data);
         } catch (Exception $e) {
             die('Template not Found!');
         }
         $this->postRender();
         Cache::add($cacheKey, $output, $this->cacheLifetime);
     }
     return $output;
 }
Example #5
0
/**
 * A shortcut wrapper around the
 * @param string $template
 * @param array $data
 */
function t($template, $data = array(), $view = null)
{
    return TemplateEngine::render($template, $data, $view);
}