当前位置: 首页>>代码示例>>PHP>>正文


PHP Smarty_Internal_Debug::ignore方法代码示例

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


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

示例1: compileChildBlock

 /**
  * Compile saved child block source
  *
  * @param object $compiler  compiler object
  * @param string $_name     optional name of child block
  * @return string   compiled code of child block
  */
 static function compileChildBlock($compiler, $_name = null)
 {
     if ($compiler->inheritance_child) {
         $name1 = Smarty_Internal_Compile_Block::$nested_block_names[0];
         if (isset($compiler->template->block_data[$name1])) {
             //  replace inner block name with generic
             Smarty_Internal_Compile_Block::$block_data[$name1]['source'] .= $compiler->template->block_data[$name1]['source'];
             Smarty_Internal_Compile_Block::$block_data[$name1]['child'] = true;
         }
         $compiler->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBLOCK);
         $compiler->has_code = false;
         return;
     }
     // if called by {$smarty.block.child} we must search the name of enclosing {block}
     if ($_name == null) {
         $stack_count = count($compiler->_tag_stack);
         while (--$stack_count >= 0) {
             if ($compiler->_tag_stack[$stack_count][0] == 'block') {
                 $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'], "\"'");
                 break;
             }
         }
     }
     if ($_name == null) {
         $compiler->trigger_template_error(' tag {$smarty.block.child} used outside {block} tags ', $compiler->lex->taglineno);
     }
     // undefined child?
     if (!isset($compiler->template->block_data[$_name]['source'])) {
         $compiler->popTrace();
         return '';
     }
     // flag that child is already compile by {$smarty.block.child} inclusion
     $compiler->template->block_data[$_name]['compiled'] = true;
     $_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id,
         $compiler->template->compile_id, $compiler->template->caching, $compiler->template->cache_lifetime);
     if ($compiler->smarty->debugging) {
         Smarty_Internal_Debug::ignore($_tpl);
     }
     $_tpl->tpl_vars = $compiler->template->tpl_vars;
     $_tpl->variable_filters = $compiler->template->variable_filters;
     $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
     $_tpl->allow_relative_path = true;
     $_tpl->compiler->inheritance = true;
     $_tpl->compiler->suppressHeader = true;
     $_tpl->compiler->suppressFilter = true;
     $_tpl->compiler->suppressTemplatePropertyHeader = true;
     $_tpl->compiler->suppressMergedTemplates = true;
     $nocache = $compiler->nocache || $compiler->tag_nocache;
     if (strpos($compiler->template->block_data[$_name]['source'], self::parent) !== false) {
         $_output = str_replace(self::parent, $compiler->parser->current_buffer->to_smarty_php(), $_tpl->compiler->compileTemplate($_tpl, $nocache));
     } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') {
         $_output = $_tpl->compiler->compileTemplate($_tpl, $nocache) . $compiler->parser->current_buffer->to_smarty_php();
     } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') {
         $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->compiler->compileTemplate($_tpl, $nocache);
     } elseif (!empty($compiler->template->block_data[$_name])) {
         $_output = $_tpl->compiler->compileTemplate($_tpl, $nocache);
     }
     $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
     $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
     $compiler->merged_templates = array_merge($compiler->merged_templates, $_tpl->compiler->merged_templates);
     $compiler->template->variable_filters = $_tpl->variable_filters;
     if ($_tpl->has_nocache_code) {
         $compiler->template->has_nocache_code = true;
     }
     foreach ($_tpl->required_plugins as $key => $tmp1) {
         if ($compiler->nocache && $compiler->template->caching) {
             $code = 'nocache';
         } else {
             $code = $key;
         }
         foreach ($tmp1 as $name => $tmp) {
             foreach ($tmp as $type => $data) {
                 $compiler->template->required_plugins[$code][$name][$type] = $data;
             }
         }
     }
     unset($_tpl);
     $compiler->has_code = true;
     return $_output;
 }
开发者ID:eltonsarmento,项目名称:CursosIAG,代码行数:87,代码来源:smarty_internal_compile_block.php


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