當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tpl::fetch方法代碼示例

本文整理匯總了PHP中Tpl::fetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tpl::fetch方法的具體用法?PHP Tpl::fetch怎麽用?PHP Tpl::fetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tpl的用法示例。


在下文中一共展示了Tpl::fetch方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * render a .tpl
  */
 public function render($tpl, $parames = array())
 {
     parent::$compile_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "templates_c";
     parent::$template_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "templates";
     parent::assign($parames);
     return parent::fetch("{$tpl}");
 }
開發者ID:jianyongchen,項目名稱:smpss,代碼行數:10,代碼來源:STpl.class.php

示例2: display

 /**
  * like as render except delimiter 
  */
 public function display($tpl, $parames = array())
 {
     parent::$compile_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "templates_c";
     parent::$template_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "templates";
     parent::$left_delimiter = '<{';
     parent::$right_delimiter = '}>';
     parent::assign($parames);
     return parent::fetch("{$tpl}");
 }
開發者ID:luofei614,項目名稱:slightphp,代碼行數:12,代碼來源:STpl.class.php

示例3: tpl_function_include

function tpl_function_include($tpl)
{
    return Tpl::fetch($tpl);
}
開發者ID:ssdphp,項目名稱:ssdphp,代碼行數:4,代碼來源:Tpl.function.php

示例4: OutputPage

 /**
  * Function to output the templates
  * @param array $templates The collection of templates with their associated variables
  *
  */
 function OutputPage($templates = array())
 {
     if (sizeof($templates) == 0) {
         trigger_error("Templates not configured properly", E_USER_ERROR);
     }
     // Define a set of common variables which plugin to the structure template.
     $page = new Tpl();
     $body = '';
     // Loop through the templates array to dynamically create objects and assign variables to them.
     /// XXX: this is not a common way to use our template class, but I didn't want to rewrite
     ///      the whole setup only to change the templating engine
     foreach ($templates as $name => $module) {
         foreach ($module['vars'] as $var_name => $value) {
             $page->assign($var_name, $value);
         }
         if ($name == 'structure') {
             $page->assign('body', $body);
             $page->display('structure.tpl');
         } else {
             $body .= $page->fetch($module['template']);
         }
     }
 }
開發者ID:heptalium,項目名稱:flyspray,代碼行數:28,代碼來源:index.php


注:本文中的Tpl::fetch方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。