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


PHP ParserOutput::addWarning方法代码示例

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


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

示例1: limitationWarn

 /**
  * Warn the user when a parser limitation is reached
  * Will warn at most once the user per limitation type
  *
  * The results are shown during preview and run through the Parser (See EditPage.php)
  *
  * @param string $limitationType Should be one of:
  *   'expensive-parserfunction' (corresponding messages:
  *       'expensive-parserfunction-warning',
  *       'expensive-parserfunction-category')
  *   'post-expand-template-argument' (corresponding messages:
  *       'post-expand-template-argument-warning',
  *       'post-expand-template-argument-category')
  *   'post-expand-template-inclusion' (corresponding messages:
  *       'post-expand-template-inclusion-warning',
  *       'post-expand-template-inclusion-category')
  *   'node-count-exceeded' (corresponding messages:
  *       'node-count-exceeded-warning',
  *       'node-count-exceeded-category')
  *   'expansion-depth-exceeded' (corresponding messages:
  *       'expansion-depth-exceeded-warning',
  *       'expansion-depth-exceeded-category')
  * @param string|int|null $current Current value
  * @param string|int|null $max Maximum allowed, when an explicit limit has been
  *	 exceeded, provide the values (optional)
  */
 public function limitationWarn($limitationType, $current = '', $max = '')
 {
     # does no harm if $current and $max are present but are unnecessary for the message
     # Not doing ->inLanguage( $this->mOptions->getUserLangObj() ), since this is shown
     # only during preview, and that would split the parser cache unnecessarily.
     $warning = wfMessage("{$limitationType}-warning")->numParams($current, $max)->text();
     $this->mOutput->addWarning($warning);
     $this->addTrackingCategory("{$limitationType}-category");
 }
开发者ID:rrameshs,项目名称:mediawiki,代码行数:35,代码来源:Parser.php

示例2: limitationWarn

 /**
  * Warn the user when a parser limitation is reached
  * Will warn at most once the user per limitation type
  *
  * @param string $limitationType should be one of:
  *   'expensive-parserfunction' (corresponding messages:
  *       'expensive-parserfunction-warning',
  *       'expensive-parserfunction-category')
  *   'post-expand-template-argument' (corresponding messages:
  *       'post-expand-template-argument-warning',
  *       'post-expand-template-argument-category')
  *   'post-expand-template-inclusion' (corresponding messages:
  *       'post-expand-template-inclusion-warning',
  *       'post-expand-template-inclusion-category')
  *   'node-count-exceeded' (corresponding messages:
  *       'node-count-exceeded-warning',
  *       'node-count-exceeded-category')
  *   'expansion-depth-exceeded' (corresponding messages:
  *       'expansion-depth-exceeded-warning',
  *       'expansion-depth-exceeded-category')
  * @param int|null $current Current value
  * @param int|null $max Maximum allowed, when an explicit limit has been
  *	 exceeded, provide the values (optional)
  */
 function limitationWarn($limitationType, $current = '', $max = '')
 {
     # does no harm if $current and $max are present but are unnecessary for the message
     $warning = wfMessage("{$limitationType}-warning")->numParams($current, $max)->inLanguage($this->mOptions->getUserLangObj())->text();
     $this->mOutput->addWarning($warning);
     $this->addTrackingCategory("{$limitationType}-category");
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:31,代码来源:Parser.php

示例3: limitationWarn

 /**
  * Warn the user when a parser limitation is reached
  * Will warn at most once the user per limitation type
  *
  * @param $limitationType String: should be one of:
  *   'expensive-parserfunction' (corresponding messages:
  *       'expensive-parserfunction-warning',
  *       'expensive-parserfunction-category')
  *   'post-expand-template-argument' (corresponding messages:
  *       'post-expand-template-argument-warning',
  *       'post-expand-template-argument-category')
  *   'post-expand-template-inclusion' (corresponding messages:
  *       'post-expand-template-inclusion-warning',
  *       'post-expand-template-inclusion-category')
  * @param $current Current value
  * @param $max Maximum allowed, when an explicit limit has been
  *	 exceeded, provide the values (optional)
  */
 function limitationWarn($limitationType, $current = null, $max = null)
 {
     # does no harm if $current and $max are present but are unnecessary for the message
     $warning = wfMsgExt("{$limitationType}-warning", array('parsemag', 'escape'), $current, $max);
     $this->mOutput->addWarning($warning);
     $this->addTrackingCategory("{$limitationType}-category");
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:25,代码来源:Parser.php


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