• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Smarty_Internal_Debug类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Smarty_Internal_Debug的典型用法代码示例。如果您正苦于以下问题:PHP Smarty_Internal_Debug类的具体用法?PHP Smarty_Internal_Debug怎么用?PHP Smarty_Internal_Debug使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Smarty_Internal_Debug类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _display

 function _display($output = '')
 {
     parent::_display($output);
     if (class_exists('CI_Controller') && class_exists('Smarty_Internal_Debug') && (config_item('smarty_debug') || $this->enable_profiler)) {
         $CI =& get_instance();
         $smarty_debug = new Smarty_Internal_Debug();
         $smarty_debug->display_debug($CI->ci_smarty);
     }
 }
开发者ID:edemilson,项目名称:ci-hmvc-smarty-doctrine-seed,代码行数:9,代码来源:MY_Output.php


示例2: content_5467bc02e6f7f7_87226601

    function content_5467bc02e6f7f7_87226601($_smarty_tpl)
    {
        $_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug');
        Smarty_Internal_Debug::display_debug($_smarty_tpl);
        ?>
test<?php 
    }
开发者ID:pawelbienko,项目名称:ssnlab,代码行数:7,代码来源:e4bb86af7a1e4cb6e90080f9476d9869291aa00a.file.index.tpl.php


示例3: createData

 /**
  * creates a data object
  *
  * @param object $parent next higher level of Smarty variables
  * @param string $name   optional data block name
  *
  * @returns Smarty_Data data object
  */
 public function createData($parent = null, $name = null)
 {
     $dataObj = new Smarty_Data($parent, $this, $name);
     if ($this->debugging) {
         Smarty_Internal_Debug::register_data($dataObj);
     }
     return $dataObj;
 }
开发者ID:dower-d,项目名称:shop,代码行数:16,代码来源:smarty_internal_templatebase.php


示例4: _display

 public function _display($output = '')
 {
     parent::_display($output);
     // If Smarty is active - NOTE: $this->output->enable_profiler(TRUE) active Smarty debug to simplify
     if (class_exists('CI_Controller') && class_exists('Smarty_Internal_Debug') && (config_item('smarty_debug') || $this->enable_profiler)) {
         $CI =& get_instance();
         Smarty_Internal_Debug::display_debug($CI->smarty);
     }
 }
开发者ID:sunnyzwh,项目名称:ci,代码行数:9,代码来源:MY_Output.php


示例5: createData

 /**
  * creates a data object
  *
  * @api  Smarty::createData()
  * @link http://www.smarty.net/docs/en/api.create.data.tpl
  *
  * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty      $obj
  * @param \Smarty_Internal_Template|\Smarty_Internal_Data|\Smarty_Data|\Smarty $parent next higher level of Smarty
  *                                                                                     variables
  * @param string                                                               $name   optional data block name
  *
  * @returns Smarty_Data data object
  */
 public function createData(Smarty_Internal_TemplateBase $obj, Smarty_Internal_Data $parent = null, $name = null)
 {
     /* @var Smarty $smarty */
     $smarty = isset($this->smarty) ? $this->smarty : $obj;
     $dataObj = new Smarty_Data($parent, $smarty, $name);
     if ($smarty->debugging) {
         Smarty_Internal_Debug::register_data($dataObj);
     }
     return $dataObj;
 }
开发者ID:smart-com,项目名称:bike-cms,代码行数:23,代码来源:smarty_internal_method_createdata.php


示例6: configLoad

 /**
  * @param        $obj
  * @param        $config_file
  * @param null   $sections
  * @param string $scope
  */
 static function configLoad($obj, $config_file, $sections = null, $scope = 'local')
 {
     $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
     $confObj = new $smarty->template_class($config_file, $smarty, $obj);
     $confObj->caching = Smarty::CACHING_OFF;
     $confObj->source = Smarty_Template_Config::load($confObj);
     $confObj->source->config_sections = $sections;
     $confObj->source->scope = $scope;
     $confObj->compiled = Smarty_Template_Compiled::load($confObj);
     if ($confObj->smarty->debugging) {
         Smarty_Internal_Debug::start_render($confObj);
     }
     $confObj->compiled->render($confObj);
     if ($confObj->smarty->debugging) {
         Smarty_Internal_Debug::end_render($confObj);
     }
     if ($obj instanceof Smarty_Internal_Template) {
         $obj->properties['file_dependency'][$confObj->source->uid] = array($confObj->source->filepath, $confObj->source->timestamp, $confObj->source->type);
     }
 }
开发者ID:nstungxd,项目名称:F2CA5,代码行数:26,代码来源:smarty_internal_extension_config.php


示例7: configLoad

 /**
  * @param                         $obj
  * @param                         $config_file
  * @param null                    $sections
  * @param string                  $scope
  *
  * @throws \SmartyException
  */
 static function configLoad($obj, $config_file, $sections = null, $scope = 'local')
 {
     $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
     $confObj = new $smarty->template_class($config_file, $smarty, $obj);
     $confObj->context = new Smarty_Internal_Context();
     $confObj->caching = Smarty::CACHING_OFF;
     $confObj->source = Smarty_Template_Config::load($confObj);
     $confObj->source->config_sections = $sections;
     $confObj->source->scope = $scope;
     $confObj->compiled = Smarty_Template_Compiled::load($confObj);
     if ($confObj->smarty->debugging) {
         Smarty_Internal_Debug::start_render($confObj);
     }
     $confObj->compiled->render($confObj);
     $confObj->context = null;
     if ($confObj->smarty->debugging) {
         Smarty_Internal_Debug::end_render($confObj);
     }
     if ($obj instanceof Smarty_Internal_Template && isset($obj->context)) {
         $obj->context->resourceInfo[$confObj->source->uid] = array($confObj->source->filepath, $confObj->source->timestamp, $confObj->source->type);
     } else {
         // TODO   config file dependency if loaded in Smarty, Data or Template object
     }
 }
开发者ID:uwetews,项目名称:smarty-hhvm,代码行数:32,代码来源:smarty_internal_extension_config.php


示例8: smartyDebug

 function smartyDebug()
 {
     if (!defined('Smarty::SMARTY_VERSION')) {
         return;
     }
     $c = Ethna_Controller::getInstance();
     $debug_tpl = $c->getDirectory('template') . "/smarty_debug.tpl";
     //if smarty2
     //if (!file_exists($debug_tpl)) {
     //    Ethna::raiseWarning(sprintf("Smarty debug template not found, please set %s.", $debug_tpl), E_USER_WARNING);
     //    return null;
     //}
     require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_debug.php';
     // get template directory
     $r = $c->getRenderer();
     $smarty = $r->getEngine();
     $vars = Smarty_Internal_Debug::get_debug_vars($smarty);
     //$smarty_original_debugging = $smarty->debugging;
     //$smarty_original_debugtpl = $smarty->debug_tpl;
     //$smarty->debugging = true;
     //$smarty->debug_tpl = $debug_tpl;
     //$smarty->assign('_smarty_debug_output', 'html');
     echo '<div class="ethna-debug" id="ethna-debug-smartydebugwindow">';
     echo '<div class="ethna-debug-title">SmartyDebug</div>';
     echo '<div class="ethna-debug-subtitle">Smarty template vars</div>';
     echo "<div class=\"ethna-debug-log\">";
     foreach ($vars->tpl_vars as $k => $v) {
         $v = array($k => $v->value);
         self::dumpArray($v);
     }
     echo "</div> \n";
     echo '<div class="ethna-debug-subtitle">Smarty config vars</div>';
     echo "<div class=\"ethna-debug-log\">";
     foreach ($vars->config_vars as $k => $v) {
         $v = array($k => $v->value);
         self::dumpArray($v);
         //self::dumpArray($v->value);
     }
     echo "</div> \n";
     echo "</div> \n";
     echo '</div>';
     //$smarty->debugging = $smarty_original_debugging;
     //$smarty->debug_tpl = $smarty_original_debugtpl;
 }
开发者ID:hiroki-ta,项目名称:my.project,代码行数:44,代码来源:Debugtoolbar.php


示例9: renderTemplate

 /**
  * Render the output using the compiled template or the PHP template source
  * 
  * The rendering process is accomplished by just including the PHP files.
  * The only exceptions are evaluated templates (string template). Their code has 
  * to be evaluated
  */
 public function renderTemplate()
 {
     if ($this->resource_object->usesCompiler) {
         if ($this->mustCompile() && $this->compiled_template === null) {
             $this->compileTemplateSource();
         }
         if ($this->smarty->debugging) {
             Smarty_Internal_Debug::start_render($this);
         }
         $_smarty_tpl = $this;
         ob_start();
         if ($this->resource_object->isEvaluated) {
             eval("?>" . $this->compiled_template);
         } else {
             include $this->getCompiledFilepath();
             // check file dependencies at compiled code
             if ($this->smarty->compile_check) {
                 if (!empty($this->properties['file_dependency'])) {
                     $this->mustCompile = false;
                     foreach ($this->properties['file_dependency'] as $_file_to_check) {
                         $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
                         if ($resource_type == 'file') {
                             $mtime = filemtime($_file_to_check[0]);
                         } else {
                             $resource_handler = $this->loadTemplateResourceHandler($resource_type);
                             $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
                         }
                         // If ($mtime != $_file_to_check[1]) {
                         if ($mtime > $_file_to_check[1]) {
                             $this->mustCompile = true;
                             break;
                         }
                     }
                     if ($this->mustCompile) {
                         // recompile and render again
                         ob_get_clean();
                         $this->compileTemplateSource();
                         ob_start();
                         include $this->getCompiledFilepath();
                     }
                 }
             }
         }
     } else {
         if (is_callable(array($this->resource_object, 'renderUncompiled'))) {
             if ($this->smarty->debugging) {
                 Smarty_Internal_Debug::start_render($this);
             }
             ob_start();
             $this->resource_object->renderUncompiled($this);
         } else {
             throw new Exception("Resource '{$this->resource_type}' must have 'renderUncompiled' methode");
         }
     }
     $this->rendered_content = ob_get_clean();
     if (!$this->resource_object->isEvaluated && empty($this->properties['file_dependency'][$this->templateUid])) {
         $this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
     }
     if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
         $this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
         $this->parent->required_plugins['compiled'] = array_merge($this->parent->required_plugins['compiled'], $this->required_plugins['compiled']);
         $this->parent->required_plugins['cache'] = array_merge($this->parent->required_plugins['cache'], $this->required_plugins['cache']);
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::end_render($this);
     }
     // write to cache when nessecary
     if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_SAVED || $this->caching == SMARTY_CACHING_LIFETIME_CURRENT)) {
         if ($this->smarty->debugging) {
             Smarty_Internal_Debug::start_cache($this);
         }
         $this->properties['has_nocache_code'] = false;
         // get text between non-cached items
         $cache_split = preg_split("!/\\*%%SmartyNocache:{$this->properties['nocache_hash']}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$this->properties['nocache_hash']}%%\\*/!s", $this->rendered_content);
         // get non-cached items
         preg_match_all("!/\\*%%SmartyNocache:{$this->properties['nocache_hash']}%%\\*\\/(.+?)/\\*/%%SmartyNocache:{$this->properties['nocache_hash']}%%\\*/!s", $this->rendered_content, $cache_parts);
         $output = '';
         // loop over items, stitch back together
         foreach ($cache_split as $curr_idx => $curr_split) {
             // escape PHP tags in template content
             $output .= preg_replace('/(<%|%>|<\\?php|<\\?|\\?>)/', '<?php echo \'$1\'; ?>', $curr_split);
             if (isset($cache_parts[0][$curr_idx])) {
                 $this->properties['has_nocache_code'] = true;
                 // remove nocache tags from cache output
                 $output .= preg_replace("!/\\*/?%%SmartyNocache:{$this->properties['nocache_hash']}%%\\*/!", '', $cache_parts[0][$curr_idx]);
             }
         }
         // rendering (must be done before writing cache file because of {function} nocache handling)
         $_smarty_tpl = $this;
         ob_start();
         eval("?>" . $output);
         $this->rendered_content = ob_get_clean();
         // write cache file content
//.........这里部分代码省略.........
开发者ID:purna89,项目名称:TrellisDesk,代码行数:101,代码来源:smarty_internal_template.php


示例10: fetch


//.........这里部分代码省略.........
         } else {
             if (isset($_COOKIE['SMARTY_DEBUG'])) {
                 $this->smarty->debugging = true;
             }
         }
     }
     // must reset merge template date
     $_template->smarty->merged_templates_func = array();
     // get rendered template
     // disable caching for evaluated code
     if ($_template->source->recompiled) {
         $_template->caching = false;
     }
     // checks if template exists
     if (!$_template->source->exists) {
         if ($_template->parent instanceof Smarty_Internal_Template) {
             $parent_resource = " in '{$_template->parent->template_resource}'";
         } else {
             $parent_resource = '';
         }
         throw new SmartyException("Unable to load template {$_template->source->type} '{$_template->source->name}'{$parent_resource}");
     }
     // read from cache or render
     if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || !$_template->cached->valid) {
         // render template (not loaded and not in cache)
         if (!$_template->source->uncompiled) {
             /** @var Smarty_Internal_Template $_smarty_tpl
              * used in evaluated code
              */
             $_smarty_tpl = $_template;
             if ($_template->source->recompiled) {
                 $code = $_template->compiler->compileTemplate($_template);
                 if ($this->smarty->debugging) {
                     Smarty_Internal_Debug::start_render($_template);
                 }
                 try {
                     ob_start();
                     /// dark edit
                     \Dark\SmartyView\SmartyEngine::integrateViewComposers($_template);
                     /// end edit
                     eval("?>" . $code);
                     unset($code);
                 } catch (Exception $e) {
                     ob_get_clean();
                     throw $e;
                 }
             } else {
                 if (!$_template->compiled->exists || $_template->smarty->force_compile && !$_template->compiled->isCompiled) {
                     $_template->compileTemplateSource();
                     $code = file_get_contents($_template->compiled->filepath);
                     eval("?>" . $code);
                     unset($code);
                     $_template->compiled->loaded = true;
                     $_template->compiled->isCompiled = true;
                 }
                 if ($this->smarty->debugging) {
                     Smarty_Internal_Debug::start_render($_template);
                 }
                 if (!$_template->compiled->loaded) {
                     include $_template->compiled->filepath;
                     if ($_template->mustCompile) {
                         // recompile and load again
                         $_template->compileTemplateSource();
                         $code = file_get_contents($_template->compiled->filepath);
                         eval("?>" . $code);
                         unset($code);
开发者ID:baiduXM,项目名称:gbpen,代码行数:67,代码来源:smarty_internal_templatebase.php


示例11: popTrace

 /**
  *  restore file and line offset
  */
 public function popTrace()
 {
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::end_compile($this->template);
     }
     $r = array_pop($this->trace_stack);
     $this->smarty->_current_file = $r[0];
     $this->trace_filepath = $r[1];
     $this->trace_uid = $r[2];
     $this->trace_line_offset = $r[3];
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::start_compile($this->template);
     }
 }
开发者ID:NikoMostWanted,项目名称:smarty,代码行数:17,代码来源:smarty_internal_templatecompilerbase.php


示例12: getInlineSubTemplate

 /**
  * Template code runtime function to set up an inline subtemplate
  *
  * @param string  $template the resource handle of the template file
  * @param mixed   $cache_id cache id to be used with this template
  * @param mixed   $compile_id compile id to be used with this template
  * @param integer $caching cache mode
  * @param integer $cache_lifetime life time of cache data
  * @param array   $data passed parameter template variables
  * @param int     $parent_scope scope in which {include} should execute
  * @param string  $hash nocache hash code
  * @param string  $content_func name of content function
  *
  * @returns object template content
  */
 public function getInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $hash, $content_func)
 {
     $tpl = $this->setupSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope);
     $tpl->properties['nocache_hash'] = $hash;
     if (!isset($this->smarty->template_objects[$tpl->templateId])) {
         $this->smarty->template_objects[$tpl->templateId] = $tpl;
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::start_template($tpl);
         Smarty_Internal_Debug::start_render($tpl);
     }
     $tpl->properties['unifunc'] = $content_func;
     $output = $tpl->getRenderedTemplateCode();
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::end_template($tpl);
         Smarty_Internal_Debug::end_render($tpl);
     }
     if (!empty($tpl->properties['file_dependency'])) {
         $this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $tpl->properties['file_dependency']);
     }
     $this->properties['tpl_function'] = $tpl->properties['tpl_function'];
     return str_replace($tpl->properties['nocache_hash'], $this->properties['nocache_hash'], $output);
 }
开发者ID:hejxing,项目名称:jt,代码行数:38,代码来源:smarty_internal_template.php


示例13: compileTemplateSource

 /**
  * Compiles the template
  *
  * If the template is not evaluated the compiled template is saved on disk
  */
 public function compileTemplateSource()
 {
     if (!$this->source->recompiled) {
         $this->properties['file_dependency'] = array();
         if ($this->source->components) {
             // uses real resource for file dependency
             $source = end($this->source->components);
             $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $source->type);
         } else {
             $this->properties['file_dependency'][$this->source->uid] = array($this->source->filepath, $this->source->timestamp, $this->source->type);
         }
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::start_compile($this);
     }
     // compile locking
     if ($this->smarty->compile_locking && !$this->source->recompiled) {
         if ($saved_timestamp = $this->compiled->timestamp) {
             touch($this->compiled->filepath);
         }
     }
     // call compiler
     try {
         $code = $this->compiler->compileTemplate($this);
     } catch (Exception $e) {
         // restore old timestamp in case of error
         if ($this->smarty->compile_locking && !$this->source->recompiled && $saved_timestamp) {
             touch($this->compiled->filepath, $saved_timestamp);
         }
         throw $e;
     }
     // compiling succeded
     if (!$this->source->recompiled && $this->compiler->write_compiled_code) {
         // write compiled template
         $_filepath = $this->compiled->filepath;
         if ($_filepath === false) {
             throw new SmartyException('getCompiledFilepath() did not return a destination to save the compiled template to');
         }
         Smarty_Internal_Write_File::writeFile($_filepath, $code, $this->smarty);
         $this->compiled->exists = true;
         $this->compiled->isCompiled = true;
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::end_compile($this);
     }
     // release compiler object to free memory
     unset($this->compiler);
 }
开发者ID:Tipkin-Commons,项目名称:tipkin,代码行数:53,代码来源:smarty_internal_template.php


示例14: compileTemplate

 /**
  * Method to compile Smarty config source.
  *
  * @param Smarty_Internal_Template $template
  *
  * @return bool true if compiling succeeded, false if it failed
  */
 public function compileTemplate(Smarty_Internal_Template $template)
 {
     $this->template = $template;
     $this->template->properties['file_dependency'][$this->template->source->uid] = [$this->template->source->name, $this->template->source->timestamp, $this->template->source->type];
     // on empty config just return
     if ($template->source->content == '') {
         return true;
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::start_compile($this->template);
     }
     // init the lexer/parser to compile the config file
     $lex = new $this->lexer_class(str_replace(["\r\n", "\r"], "\n", $template->source->content) . "\n", $this);
     $parser = new $this->parser_class($lex, $this);
     if (function_exists('mb_internal_encoding') && (int) ini_get('mbstring.func_overload') & 2) {
         $mbEncoding = mb_internal_encoding();
         mb_internal_encoding('ASCII');
     } else {
         $mbEncoding = null;
     }
     if ($this->smarty->_parserdebug) {
         $parser->PrintTrace();
     }
     // get tokens from lexer and parse them
     while ($lex->yylex()) {
         if ($this->smarty->_parserdebug) {
             echo "<br>Parsing  {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
         }
         $parser->doParse($lex->token, $lex->value);
     }
     // finish parsing process
     $parser->doParse(0, 0);
     if ($mbEncoding) {
         mb_internal_encoding($mbEncoding);
     }
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::end_compile($this->template);
     }
     // template header code
     $template_header = "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";
     $template_header .= "         compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";
     $code = '<?php Smarty_Internal_Extension_Config::loadConfigVars($_smarty_tpl, ' . var_export($this->config_data, true) . '); ?>';
     return $template_header . Smarty_Internal_Extension_CodeFrame::create($this->template, $code);
 }
开发者ID:hejxing,项目名称:jt,代码行数:51,代码来源:smarty_internal_config_file_compiler.php


示例15: createTemplate

 /**
  * creates a template object
  *
  * @param  string  $template   the resource handle of the template file
  * @param  mixed   $cache_id   cache id to be used with this template
  * @param  mixed   $compile_id compile id to be used with this template
  * @param  object  $parent     next higher level of Smarty variables
  * @param  boolean $do_clone   flag is Smarty object shall be cloned
  *
  * @return object  template object
  */
 public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
 {
     if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {
         $parent = $cache_id;
         $cache_id = null;
     }
     if ($parent !== null && is_array($parent)) {
         $data = $parent;
         $parent = null;
     } else {
         $data = null;
     }
     $_templateId = $this->getTemplateId($template, $cache_id, $compile_id);
     if (isset($this->template_objects[$_templateId])) {
         if ($do_clone) {
             $tpl = clone $this->template_objects[$_templateId];
             $tpl->smarty = clone $tpl->smarty;
         } else {
             $tpl = $this->template_objects[$_templateId];
         }
         $tpl->parent = $parent;
         $tpl->tpl_vars = array();
         $tpl->config_vars = array();
     } else {
         $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
         if ($do_clone) {
             $tpl->smarty = clone $tpl->smarty;
         }
         $tpl->templateId = $_templateId;
     }
     // fill data if present
     if (!empty($data) && is_array($data)) {
         // set up variable values
         foreach ($data as $_key => $_val) {
             $tpl->tpl_vars[$_key] = new Smarty_Variable($_val);
         }
     }
     if ($this->debugging) {
         Smarty_Internal_Debug::register_template($tpl);
     }
     return $tpl;
 }
开发者ID:redaxle,项目名称:smarty,代码行数:53,代码来源:Smarty.class.php


示例16: pushTrace

 /**
  *  push current file and line offset on stack for tracing {block} source lines
  * @param string $file new filename
  * @param string $uid uid of file
  * @param int $line line offset to source
  * @param bool $debug false debug end_compile shall not be called
  */
 public function pushTrace($file, $uid, $line, $debug = TRUE)
 {
     if ($this->smarty->debugging && $debug) {
         Smarty_Internal_Debug::end_compile($this->template);
     }
     array_push($this->trace_stack, [$this->smarty->_current_file, $this->trace_filepath, $this->trace_uid, $this->trace_line_offset]);
     $this->trace_filepath = $this->smarty->_current_file = $file;
     $this->trace_uid = $uid;
     $this->trace_line_offset = $line;
     if ($this->smarty->debugging) {
         Smarty_Internal_Debug::start_compile($this->template);
     }
 }
开发者ID:rendix2,项目名称:QW_MVS,代码行数:20,代码来源:smarty_internal_templatecompilerbase.php


示例17: getInlineSubTemplate

 /**
  * Template code runtime function to set up an inline subtemplate
  *
  * @param string  $template       the resource handle of the template file
  * @param mixed   $cache_id       cache id to be used with this template
  * @param mixed   $compile_id     compile id to be used with this template
  * @param integer $caching        cache mode
  * @param integer $cache_lifetime life time of cache data
  * @param array   $data           passed parameter template variables
  * @param         $_scope
  * @param         $parent
  * @param string  $content_func   name of content function
  *
  * @param bool    $newBuffer
  *
  * @return object template content
  */
 public function getInlineSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $_scope, $parent, $params, $newBuffer = false)
 {
     $tpl = $parent->smarty->setupTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $_scope, $parent);
     $tpl->context = $newBuffer ? new Smarty_Internal_Context() : $parent->context;
     if ($tpl->smarty->debugging) {
         Smarty_Internal_Debug::start_template($tpl);
         Smarty_Internal_Debug::start_render($tpl);
     }
     $this->getRenderedTemplateCode($tpl, $params['func']);
     if ($tpl->smarty->debugging) {
         Smarty_Internal_Debug::end_template($tpl);
         Smarty_Internal_Debug::end_render($tpl);
     }
     if ($newBuffer) {
         $output = $tpl->context->getContent();
         $tpl->context = null;
         return $output;
     }
     $tpl->context = null;
     return '';
 }
开发者ID:uwetews,项目名称:smarty-hhvm,代码行数:38,代码来源:smarty_internal_runtime.php


示例18: content_5658c1ca58b0a9_07432000

    function content_5658c1ca58b0a9_07432000($_smarty_tpl)
    {
        $_smarty_tpl->properties['nocache_hash'] = '139795658c1ca453b72_59622192';
        $_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug');
        Smarty_Internal_Debug::display_debug($_smarty_tpl);
        echo $_smarty_tpl->getSubTemplate("head.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0);
        ?>


<!--<nav>
	<ul>
		<?php 
        $_from = $_smarty_tpl->tpl_vars['items']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['item']->_loop = false;
        foreach ($_from as $_smarty_tpl->tpl_vars['item']->value) {
            $_smarty_tpl->tpl_vars['item']->_loop = true;
            $foreach_item_Sav = $_smarty_tpl->tpl_vars['item'];
            ?>
			<li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['item']->value['lien'];
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['item']->value['texte'];
            ?>
</a></li>
		<?php 
            $_smarty_tpl->tpl_vars['item'] = $foreach_item_Sav;
        }
        ?>
	</ul>
</nav>
-->
<?php 
        $_smarty_tpl->properties['nocache_hash'] = '139795658c1ca453b72_59622192';
        ?>


<form action="validation.php" method = "POST">

<p>Un seul vote par jour et par IP.</p>

<label for="categorie">Catégorie du vote :</label>
<select name="categorie" required>
	<option></option>
	<?php 
        $_from = $_smarty_tpl->tpl_vars['categories']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['categorie'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['categorie']->_loop = false;
        foreach ($_from as $_smarty_tpl->tpl_vars['categorie']->value) {
            $_smarty_tpl->tpl_vars['categorie']->_loop = true;
            $foreach_categorie_Sav = $_smarty_tpl->tpl_vars['categorie'];
            ?>
		<option value="<?php 
            echo $_smarty_tpl->tpl_vars['categorie']->value;
            ?>
"><?php 
            echo $_smarty_tpl->tpl_vars['categorie']->value;
            ?>
</option>
	<?php 
            $_smarty_tpl->tpl_vars['categorie'] = $foreach_categorie_Sav;
        }
        ?>
</select>
<br />

<label for="positif" required>Vote :</label>
<select name="positif">
	<option></option>
	<?php 
        $_from = $_smarty_tpl->tpl_vars['matieres']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['matiere'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['matiere']->_loop = false;
        foreach ($_from as $_smarty_tpl->tpl_vars['matiere']->value) {
            $_smarty_tpl->tpl_vars['matiere']->_loop = true;
            $foreach_matiere_Sav = $_smarty_tpl->tpl_vars['matiere'];
            ?>
	<optgroup label="<?php 
            echo $_smarty_tpl->tpl_vars['matiere']->value;
            ?>
">
		<?php 
            $_from = $_smarty_tpl->tpl_vars['profs']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['prof'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['prof']->_loop = false;
            foreach ($_from as $_smarty_tpl->tpl_vars['prof']->value) {
                $_smarty_tpl->tpl_vars['prof']->_loop = true;
//.........这里部分代码省略.........
开发者ID:Amaras,项目名称:votes-rabelais,代码行数:101,代码来源:7fe2e57806ebcd1524d62e89890192d3acb8f82e_0.file.vote.html.php


示例19: fetch

 /**
  * fetches a rendered Smarty template
  * 
  * @param string $template the resource handle of the template file or template object
  * @param mixed $cache_id cache id to be used with this template
  * @param mixed $compile_id compile id to be used with this template
  * @param object $ |null $parent next higher level of Smarty variables
  * @return string rendered template output
  */
 public function fetch($template, $cache_id = null, $compile_id = null, $parent = null, $display = false)
 {
     if (is_object($cache_id)) {
         $parent = $cache_id;
         $cache_id = null;
     }
     if ($parent === null) {
         // get default Smarty data object
         $parent = $this;
     }
     array_push($this->block_data_stack, $this->block_data);
     $this->block_data = array();
     // create template object if necessary
     $template instanceof $this->template_class ? $_template = $template : ($_template = $this->createTemplate($template, $cache_id, $compile_id, $parent));
     $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting) ? $this->error_reporting : error_reporting() & ~E_NOTICE);
     // obtain data for cache modified check
     if ($this->cache_modified_check && $this->caching && $display) {
         $_isCached = $_template->isCached() && !$_template->has_nocache_code;
         if ($_isCached) {
             $_gmt_mtime = gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT';
         } else {
             $_gmt_mtime = '';
         }
     }
     // return redered template
     if (isset($this->autoload_filters['output']) || isset($this->registered_filters['output'])) {
         $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $this, $_template);
     } else {
         $_output = $_template->getRenderedTemplate();
     }
     $_template->rendered_content = null;
     error_reporting($_smarty_old_error_level);
     // display or fetch
     if ($display) {
         if ($this->caching && $this->cache_modified_check) {
             $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
             if ($_isCached && $_gmt_mtime == $_last_modified_date) {
                 if (php_sapi_name() == 'cgi') {
                     header('Status: 304 Not Modified');
                 } else {
                     header('HTTP/1.1 304 Not Modified');
                 }
             } else {
                 header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT');
                 echo $_output;
             }
         } else {
             echo $_output;
         }
         // debug output
         if ($this->debugging) {
             Smarty_Internal_Debug::display_debug($this);
         }
         $this->block_data = array_pop($this->block_data_stack);
         return;
     } else {
         // return fetched content
         $this->block_data = array_pop($this->block_data_stack);
         return $_output;
     }
 }
开发者ID:rousseau-christopher,项目名称:equinox-core,代码行数:70,代码来源:Smarty.class.php


示例20: p

 /**
  * Same as flush() but with optional debugging.
  * @see Template::flush()
  */
 function p()
 {
     $this->flush();
     if ($this->smarty->debugging) {
         global $t2;
         $this->smarty->assign(array('AAAA_DEBUG_TOTAL_TIME__' => get_elapsed_time($t2, get_moment())));
         Smarty_Internal_Debug::display_debug($this->smarty);
     }
 }
开发者ID:squidjam,项目名称:Piwigo,代码行数:13,代码来源:template.class.php



注:本文中的Smarty_Internal_Debug类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Smarty_Internal_Filter_Handler类代码示例发布时间:2022-05-23
下一篇:
PHP Smarty_Internal_Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap