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


PHP XenForo_Template_Compiler::parseNamedArguments方法代码示例

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


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

示例1: compile

 /**
  * Compiles the function call.
  *
  * @param XenForo_Template_Compiler The invoking compiler
  * @param string                 Name of the function called
  * @param array                  Arguments to the function (should have at least 1)
  * @param array                  Compilation options
  *
  * @return string
  */
 public function compile(XenForo_Template_Compiler $compiler, $function, array $arguments, array $options)
 {
     $argc = count($arguments);
     if ($argc < 4) {
         throw $compiler->getNewCompilerArgumentException();
     }
     $perPage = array_shift($arguments);
     $totalItems = array_shift($arguments);
     $page = array_shift($arguments);
     $linkType = array_shift($arguments);
     $data = 'false';
     if (isset($arguments[0])) {
         $dataRef = array_shift($arguments);
         $data = $compiler->compileAndCombineSegments($dataRef, array_merge($options, array('varEscape' => false)));
     }
     $params = $compiler->getNamedParamsAsPhpCode($compiler->parseNamedArguments($arguments), array_merge($options, array('varEscape' => false)));
     $phpFunction = $function == 'adminpagenav' ? 'adminPageNav' : 'pageNav';
     return 'XenForo_Template_Helper_Core::' . $phpFunction . '(' . $compiler->compileAndCombineSegments($perPage, $options) . ', ' . $compiler->compileAndCombineSegments($totalItems, $options) . ', ' . $compiler->compileAndCombineSegments($page, $options) . ', ' . $compiler->compileAndCombineSegments($linkType, $options) . ', ' . $data . ', ' . $params . ')';
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:29,代码来源:PageNav.php

示例2: compile

 /**
  * Compiles the function call.
  *
  * @param XenForo_Template_Compiler The invoking compiler
  * @param string                 Name of the function called
  * @param array                  Arguments to the function (should have at least 1)
  * @param array                  Compilation options
  *
  * @return string
  */
 public function compile(XenForo_Template_Compiler $compiler, $function, array $arguments, array $options)
 {
     $argc = count($arguments);
     if ($argc < 1) {
         throw $compiler->getNewCompilerArgumentException();
     }
     $type = array_shift($arguments);
     $data = 'false';
     if (isset($arguments[0])) {
         $dataRef = array_shift($arguments);
         $data = $compiler->compileAndCombineSegments($dataRef, array_merge($options, array('varEscape' => false)));
     }
     $params = $compiler->getNamedParamsAsPhpCode($compiler->parseNamedArguments($arguments), array_merge($options, array('varEscape' => false)));
     $phpFunction = $function == 'adminlink' ? 'adminLink' : 'link';
     if ($options['varEscape'] != 'htmlspecialchars') {
         $varEscapeParam = ', ' . ($options['varEscape'] ? "'{$options['varEscape']}'" : 'false');
     } else {
         $varEscapeParam = '';
     }
     return 'XenForo_Template_Helper_Core::' . $phpFunction . "(" . $compiler->compileAndCombineSegments($type, $options) . ', ' . $data . ', ' . $params . $varEscapeParam . ')';
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:31,代码来源:Link.php

示例3: compile

 /**
  * Compiles the phrase call.
  *
  * @param XenForo_Template_Compiler The invoking compiler
  * @param string                 Name of the function called
  * @param array                  Arguments to the function (should have at least 1)
  * @param array                  Compilation options
  *
  * @return string
  */
 public function compile(XenForo_Template_Compiler $compiler, $function, array $arguments, array $options)
 {
     $argc = count($arguments);
     if ($argc < 1) {
         throw $compiler->getNewCompilerArgumentException();
     }
     $phraseName = $compiler->getArgumentLiteralValue(array_shift($arguments));
     if ($phraseName === false) {
         throw $compiler->getNewCompilerException(new XenForo_Phrase('phrase_name_must_be_literal'));
     }
     $phraseValue = $compiler->getPhraseValue($phraseName);
     if ($phraseValue === false) {
         return "'" . $compiler->escapeSingleQuotedString($phraseName) . "'";
     }
     $this->_params = $compiler->compileNamedParams($compiler->parseNamedArguments($arguments), $options);
     $phraseValueEscaped = $compiler->escapeSingleQuotedString($phraseValue);
     $phraseValueEscaped = preg_replace_callback('/\\{([a-z0-9_-]+)\\}/i', array($this, '_replaceParam'), $phraseValueEscaped);
     if ($phraseValueEscaped === '') {
         return '';
     }
     $this->_params = array();
     return "'" . $phraseValueEscaped . "'";
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:33,代码来源:Phrase.php

示例4: compile

 /**
  * Compiles the function call.
  *
  * @param XenForo_Template_Compiler The invoking compiler
  * @param string                 Name of the function called
  * @param array                  Arguments to the function (should have at least 1)
  * @param array                  Compilation options
  *
  * @return string
  */
 public function compile(XenForo_Template_Compiler $compiler, $function, array $arguments, array $options)
 {
     $params = $compiler->getNamedParamsAsPhpCode($compiler->parseNamedArguments($arguments), array_merge($options, array('varEscape' => false)));
     return $params;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:15,代码来源:Array.php


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