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


PHP Dwoo_Compiler::getCurrentBlock方法代碼示例

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


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

示例1: preProcessing

 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     $params = $compiler->getCompiledParams($params);
     $parsedParams = array();
     if (!isset($params['*'])) {
         $params['*'] = array();
     }
     foreach ($params['*'] as $param => $defValue) {
         if (is_numeric($param)) {
             $param = $defValue;
             $defValue = null;
         }
         $param = trim($param, '\'"');
         if (!preg_match('#^[a-z0-9_]+$#i', $param)) {
             throw new Dwoo_Compilation_Exception($compiler, 'Function : parameter names must contain only A-Z, 0-9 or _');
         }
         $parsedParams[$param] = $defValue;
     }
     $params['name'] = substr($params['name'], 1, -1);
     $params['*'] = $parsedParams;
     $params['uuid'] = uniqid();
     $compiler->addTemplatePlugin($params['name'], $parsedParams, $params['uuid']);
     $currentBlock =& $compiler->getCurrentBlock();
     $currentBlock['params'] = $params;
     return '';
 }
開發者ID:netfreak,項目名稱:pyrocms,代碼行數:26,代碼來源:template.php

示例2: preProcessing

 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     // get block params and save the current template pointer to use it in the postProcessing method
     $currentBlock =& $compiler->getCurrentBlock();
     $currentBlock['params']['tplPointer'] = $compiler->getPointer();
     return '';
 }
開發者ID:nbey,項目名稱:Emergence-Skeleton,代碼行數:7,代碼來源:loop.php

示例3: preProcessing

 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     $params = $compiler->getCompiledParams($params);
     $func = $params['__funcname'];
     $pluginType = $params['__functype'];
     $params = $params['*'];
     if ($pluginType & Dwoo_Core::CUSTOM_PLUGIN) {
         $customPlugins = $compiler->getDwoo()->getCustomPlugins();
         $callback = $customPlugins[$func]['callback'];
         if (is_array($callback)) {
             if (is_object($callback[0])) {
                 $callback = '$this->customPlugins[\'' . $func . '\'][0]->' . $callback[1] . '(';
             } else {
                 $callback = '' . $callback[0] . '::' . $callback[1] . '(';
             }
         } else {
             $callback = $callback . '(';
         }
     } else {
         $callback = 'smarty_block_' . $func . '(';
     }
     $paramsOut = '';
     foreach ($params as $i => $p) {
         $paramsOut .= var_export($i, true) . ' => ' . $p . ',';
     }
     $curBlock =& $compiler->getCurrentBlock();
     $curBlock['params']['postOut'] = Dwoo_Compiler::PHP_OPEN . ' $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $callback . '$_tag_stack[count($_tag_stack)-1], $_block_content, $this, $_block_repeat); } array_pop($_tag_stack);' . Dwoo_Compiler::PHP_CLOSE;
     return Dwoo_Compiler::PHP_OPEN . $prepend . ' if (!isset($_tag_stack)){ $_tag_stack = array(); } $_tag_stack[] = array(' . $paramsOut . '); $_block_repeat=true; ' . $callback . '$_tag_stack[count($_tag_stack)-1], null, $this, $_block_repeat); while ($_block_repeat) { ob_start();' . Dwoo_Compiler::PHP_CLOSE;
 }
開發者ID:nbey,項目名稱:Emergence-Skeleton,代碼行數:29,代碼來源:smartyinterface.php

示例4: postProcessing

 public static function postProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $content)
 {
     if (!isset($params['initialized'])) {
         return '';
     }
     $block =& $compiler->getCurrentBlock();
     $block['params']['hasElse'] = Dwoo_Compiler::PHP_OPEN . "else {\n" . Dwoo_Compiler::PHP_CLOSE . $content . Dwoo_Compiler::PHP_OPEN . "\n}" . Dwoo_Compiler::PHP_CLOSE;
     return '';
 }
開發者ID:nbey,項目名稱:Emergence-Skeleton,代碼行數:9,代碼來源:forelse.php

示例5: preProcessing

 public static function preProcessing(Dwoo_Compiler $compiler, array $params, $prepend, $append, $type)
 {
     $preContent = '';
     while (true) {
         $preContent .= $compiler->removeTopBlock();
         $block =& $compiler->getCurrentBlock();
         $interfaces = class_implements($block['class'], false);
         if (in_array('Dwoo_IElseable', $interfaces) !== false) {
             break;
         }
     }
     $params['initialized'] = true;
     $compiler->injectBlock($type, $params);
     return $preContent;
 }
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:15,代碼來源:elseif.php


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