BVB Source Codes

The latest thinkphp v5.2 work order system Show smarty_internal_compile_private_block_plugin.php Source code

Return Download The latest thinkphp v5.2 work order system: download smarty_internal_compile_private_block_plugin.php Source code - Download The latest thinkphp v5.2 work order system Source code - Type:.php
  1. <?php
  2. /**
  3.  * Smarty Internal Plugin Compile Block Plugin
  4.  *
  5.  * Compiles code for the execution of block plugin
  6.  *
  7.  * @package Smarty
  8.  * @subpackage Compiler
  9.  * @author Uwe Tews
  10.  */
  11.  
  12. /**
  13.  * Smarty Internal Plugin Compile Block Plugin Class
  14.  *
  15.  * @package Smarty
  16.  * @subpackage Compiler
  17.  */
  18. class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase {
  19.  
  20.     /**
  21.      * Attribute definition: Overwrites base class.
  22.      *
  23.      * @var array
  24.      * @see Smarty_Internal_CompileBase
  25.      */
  26.     public $optional_attributes = array('_any');
  27.  
  28.     /**
  29.      * Compiles code for the execution of block plugin
  30.      *
  31.      * @param array  $args      array with attributes from parser
  32.      * @param object $compiler  compiler object
  33.      * @param array  $parameter array with compilation parameter
  34.      * @param string $tag       name of block plugin
  35.      * @param string $function  PHP function name
  36.      * @return string compiled code
  37.      */
  38.     public function compile($args, $compiler, $parameter, $tag, $function)
  39.     {
  40.         if (!isset($tag[5]) || substr($tag, -5) != 'close') {
  41.             // opening tag of block plugin
  42.             // check and get attributes
  43.             $_attr = $this->getAttributes($compiler, $args);
  44.             if ($_attr['nocache'] === true) {
  45.                 $compiler->tag_nocache = true;
  46.             }
  47.                unset($_attr['nocache']);
  48.             // convert attributes into parameter array string
  49.             $_paramsArray = array();
  50.             foreach ($_attr as $_key => $_value) {
  51.                 if (is_int($_key)) {
  52.                     $_paramsArray[] = "$_key=>$_value";
  53.                 } else {
  54.                     $_paramsArray[] = "'$_key'=>$_value";
  55.                 }
  56.             }
  57.             $_params = 'array(' . implode(",", $_paramsArray) . ')';
  58.  
  59.             $this->openTag($compiler, $tag, array($_params, $compiler->nocache));
  60.             // maybe nocache because of nocache variables or nocache plugin
  61.             $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
  62.             // compile code
  63.             $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
  64.         } else {
  65.             // must endblock be nocache?
  66.             if ($compiler->nocache) {
  67.                 $compiler->tag_nocache = true;
  68.             }
  69.             // closing tag of block plugin, restore nocache
  70.             list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, -5));
  71.             // This tag does create output
  72.             $compiler->has_output = true;
  73.             // compile code
  74.             if (!isset($parameter['modifier_list'])) {
  75.                 $mod_pre = $mod_post ='';
  76.             } else {
  77.                 $mod_pre = ' ob_start(); ';
  78.                 $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';
  79.             }
  80.             $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
  81.         }
  82.         return $output . "\n";
  83.     }
  84.  
  85. }
  86.  
  87. ?>
downloadsmarty_internal_compile_private_block_plugin.php Source code - Download The latest thinkphp v5.2 work order system Source code
Related Source Codes/Software:
V3.3.6 Workerman high-performance PHP Socket (framework) - High performance PHP Socket framework Workerman re... 2017-05-03
The phosphor meeting room reservation system MRBS (loop reservation v16.0) - The phosphor meeting room reservation system MRBS ... 2017-05-03
IDC v5.2.3 agent center - IDC Centre IDC for exploitation is a PHP+MySQL age... 2017-05-03
Zen master v9.0.1 project management software - Zen is the first domestic open source project mana... 2017-05-03
Ray speed v7.03 employee files management system - Employee files project is various, and some conten... 2017-05-03
HITCMS Haitian responsive electronic mechanical v3.0 foreign trade website source code - HITCMS Haitian response electronic machinery trade... 2017-05-03
Ray v7.02 speed survey system - Lightning speed survey system is a. NET+MSSQL deve... 2017-05-03
Cool HITCMS reactive black v3.0 enterprise website source code - HITCMS-Haitian response black enterprises website ... 2017-05-03
WebOA v17.2 network office automation system - WebOA network using b/s structure development of o... 2017-05-03
Pure imitation of han site source code, one a 】 【 c9cms kernel v1.0 - Generic http://www.wufazhuce.com/Han one · Config... 2017-05-04
zone.js - Implements Zones for JavaScript ... 2017-05-11
dragonfly - A Ruby gem for on-the-fly processing - suitable fo... 2017-05-11
oh-my-fish - The Fishshell Framework. 2017-05-11
canvas-lms - The open LMS by Instructure, Inc. 2017-05-11
ledger - Double-entry accounting system with a command-line... 2017-05-11
Python - My Python Examples http://w... 2017-05-11
blade - 2017-05-11
LaZagne - Credentials recovery project 2017-05-10
Pull-to-Refresh.Rentals-iOS - This project aims to provide a simple and customiz... 2017-05-10
spoon - Distributing instrumentation tests to all your And... 2017-05-10

 Back to top