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


PHP Smarty_Internal_Debug::template_data方法代碼示例

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


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

示例1: display_debug

 /**
  * Opens a window for the Smarty Debugging Consol and display the data
  *
  * @param Smarty_Internal_Template|Smarty $obj object to debug
  */
 public static function display_debug($obj, $full = false)
 {
     // prepare information of assigned variables
     $ptr = self::get_debug_vars($obj);
     if ($obj instanceof Smarty) {
         $smarty = clone $obj;
     } else {
         $smarty = clone $obj->smarty;
     }
     $_assigned_vars = $ptr->tpl_vars;
     ksort($_assigned_vars);
     $_config_vars = $ptr->config_vars;
     ksort($_config_vars);
     $smarty->registered_filters = array();
     $smarty->autoload_filters = array();
     $smarty->default_modifiers = array();
     $smarty->force_compile = false;
     $smarty->left_delimiter = '{';
     $smarty->right_delimiter = '}';
     $smarty->debugging = false;
     $smarty->debugging_ctrl = 'NONE';
     $smarty->force_compile = false;
     $_template = new Smarty_Internal_Template($smarty->debug_tpl, $smarty);
     $_template->caching = false;
     $_template->disableSecurity();
     $_template->cache_id = null;
     $_template->compile_id = null;
     if ($obj instanceof Smarty_Internal_Template) {
         $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
     }
     if ($obj instanceof Smarty || $full) {
         $_template->assign('template_data', self::$template_data);
     } else {
         $_template->assign('template_data', null);
     }
     $_template->assign('assigned_vars', $_assigned_vars);
     $_template->assign('config_vars', $_config_vars);
     $_template->assign('execution_time', microtime(true) - $smarty->start_time);
     $_template->assign('display_mode', $smarty->debugging == 2 || !$full);
     echo $_template->fetch();
     if ($full) {
         self::$ignore_uid = array();
         self::$template_data = array();
     }
 }
開發者ID:uwetews,項目名稱:smarty-hhvm,代碼行數:50,代碼來源:smarty_internal_debug.php


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