예제 #1
0
 function render()
 {
     $template = new TemplateEngine($this->filepath);
     $template->set($this->templateData);
     $template->setGlobals($this->templateGlobals);
     $template->display();
     if (isset($_GET['DEBUG'])) {
         echo '<pre>';
         var_dump($this->templateData);
         echo '</pre>';
     }
 }
예제 #2
0
 /** Display output of TSunic
  *
  * Call this function to display the output of TSunic.
  * If you call this function from an ajax request, it will return xml output
  *
  * @param string $template
  *	Request output of certain template only
  *
  * @return bool
  */
 public function display($template = false)
 {
     // validate template
     if (empty($template)) {
         $template = $this->Input->get('tmpl');
         // is tmpl?
         if (empty($template)) {
             $template = '$$$html';
         }
     }
     // display templates
     if (!$this->isAjax()) {
         $this->Tmpl->display($template);
     } else {
         $this->Tmpl->responseAjax();
     }
     return true;
 }
예제 #3
0
} else {
    $isAdmin = 0;
    if ($user != null && $user->checkPermissions(0, 0, 0, 1, 1)) {
        // wenn ORDERER
        redirectURI("/orderer/index.php");
    }
    if ($user != null && $user->checkPermissions(0, 0, 1)) {
        // wenn USER
        redirectURI("/user/index.php");
    }
}
$LOG = new Log();
$tpl = new TemplateEngine("template/viewProduct.html", "template/frame.html", $lang["viewer_viewProduct"]);
$LOG->write('3', 'viewer/viewProduct.php');
$pID = $_GET['pID'];
$tpl->assign('ID', $pID);
//Produktdaten
$product_query = DB_query("SELECT\n\t\t\t\t*\n\t\t\t\tFROM products\n\t\t\t\tWHERE products_id = " . $pID . "\n\t\t\t\tAND deleted = 0\n\t\t\t\tORDER BY sort_order, name\n\t\t\t\t");
$product = DB_fetchArray($product_query);
$tpl->assign('name', $product['name']);
$tpl->assign('description', $product['description']);
//$tpl->assign('sort_order',$product['sort_order']);
$tpl->assign('active', $product['active']);
// zur Unterscheidung, ob anzeigbar, weiterhin mitliefern
$tpl->assign('image_small', $product['image_small']);
$tpl->assign('image_big', $product['image_big']);
$tpl->assign('stock', $product['stock']);
$tpl->assign('price', $product['price']);
$tpl->assign('is_admin', $isAdmin);
$tpl->display();
예제 #4
0
파일: theme.php 프로젝트: habari/system
 /**
  * Helper function: Avoids having to call $theme->template_engine->display( 'template_name' );
  * @param string $template_name The name of the template to display
  */
 public function display($template_name)
 {
     $this->play_var_stack();
     $this->template_engine->assign('theme', $this);
     $this->template_engine->display($template_name);
 }
예제 #5
0
 /**
  * 显示模版
  *
  * @param null $templateFile
  */
 protected function display($templateFile = null)
 {
     $path = $this->setTemplatePath($templateFile);
     file_exists($path) or Halt($path . '模版文件不存在');
     $this->assign('__PUBLIC__', __PUBLIC__ . '/');
     $this->assign('__UPLOAD__', __UPLOAD__ . '/');
     if (C('TEMPLATE_ENGINE_START')) {
         parent::display($path);
     } else {
         extract($this->vars);
         include $path;
     }
 }