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


PHP Parser::setHook方法代码示例

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


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

示例1: sbParserInit

function sbParserInit(Parser $parser)
{
    // Register <scratchblocks> tag
    $parser->setHook('scratchblocks', 'sbRenderTag');
    $parser->setHook('sb', 'sbRenderInlineTag');
    return true;
}
开发者ID:InternationalScratchWiki,项目名称:Dutch-mw-Scratchblocks2,代码行数:7,代码来源:ScratchBlocks2.php

示例2: onParserFirstCallSetup

 static function onParserFirstCallSetup(Parser $parser)
 {
     if (!ExtensionRegistry::getInstance()->isLoaded('Math')) {
         die("The DMath extension requires the Math extension, please include it.");
     }
     $parser->setHook('dmath', 'DMathParse::dmathTagHook');
     $parser->setHook('math', 'DMathParse::mathTagHook');
 }
开发者ID:WikiToLearn,项目名称:DMath,代码行数:8,代码来源:DMathHooks.php

示例3: onParserFirstCallInit

 /**
  * Set up our custom parser hooks when initializing parser.
  *
  * @param Parser $parser
  * @return boolean hook return value
  */
 public static function onParserFirstCallInit($parser)
 {
     $parser->setHook('pagelist', array(__CLASS__, 'renderPageList'));
     $parser->setHook('pages', array(__CLASS__, 'renderPages'));
     $parser->setHook('pagequality', array(__CLASS__, 'pageQuality'));
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:13,代码来源:ProofreadPage_body.php

示例4: onParserFirstCallInit

 /**
  *
  * @param Parser $parser
  * @return boolean
  */
 public function onParserFirstCallInit(&$parser)
 {
     $parser->setHook('bs:countarticles', array(&$this, 'onMagicWordBsCountArticles'));
     $parser->setHook('bs:countusers', array(&$this, 'onMagicWordBsCountUsers'));
     $parser->setHook('bs:countcharacters', array(&$this, 'onMagicWordBsCountCharacters'));
     return true;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:12,代码来源:CountThings.class.php

示例5: parserInit

 public static function parserInit(Parser $parser)
 {
     Hooks::register('ParserBeforeStrip', self::class . '::markBlockMathTags');
     $parser->setHook('math', self::class . '::mathTag');
     $parser->setHook('nomathjax', self::class . '::noMathJaxTag');
     Hooks::register('ParserAfterTidy', self::class . '::afterTidy');
     Hooks::register('BeforePageDisplay', self::class . '::Inject_JS');
     return true;
 }
开发者ID:muwiki,项目名称:mediawiki-mathjax,代码行数:9,代码来源:MathJax.php

示例6: register

 /**
  * @param Parser $parser
  * @return void
  */
 public static function register($parser)
 {
     global $wgRawHtml;
     $parser->setHook('pre', array(__CLASS__, 'pre'));
     $parser->setHook('nowiki', array(__CLASS__, 'nowiki'));
     $parser->setHook('gallery', array(__CLASS__, 'gallery'));
     if ($wgRawHtml) {
         $parser->setHook('html', array(__CLASS__, 'html'));
     }
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:14,代码来源:CoreTagHooks.php

示例7: wfEventCountdownExtension

/**
 * @param Parser $parser
 * @return bool
 */
function wfEventCountdownExtension($parser)
{
    # register the extension with the WikiText parser
    # the first parameter is the name of the new tag.
    # In this case it defines the tag <example> ... </example>
    # the second parameter is the callback function for
    # processing the text between the tags
    $parser->setHook('daysuntil', 'runDaysUntil');
    $parser->setHook('eventcountdown', 'runShowEventCountdown');
    return true;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:EventCountdown.php

示例8: register

 /**
  * @param Parser $parser
  * @return void
  */
 public static function register($parser)
 {
     global $wgRawHtml;
     $parser->setHook('pre', [__CLASS__, 'pre']);
     $parser->setHook('nowiki', [__CLASS__, 'nowiki']);
     $parser->setHook('gallery', [__CLASS__, 'gallery']);
     $parser->setHook('indicator', [__CLASS__, 'indicator']);
     if ($wgRawHtml) {
         $parser->setHook('html', [__CLASS__, 'html']);
     }
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:15,代码来源:CoreTagHooks.php

示例9: wfSampleParserInit

function wfSampleParserInit(Parser &$parser)
{
    // This does <setprop>Some random text</setprop>
    // And then <getprop/> to retrieve a prop
    // Or <getprop page="somepage"> to retrieve for
    // something other than the current page.
    $parser->setHook('getprop', 'wfSampleGetProp');
    $parser->setHook('setprop', 'wfSampleSetProp');
    // Always return true from this function. The return value does not denote
    // success or otherwise have meaning - it just must always be true.
    return true;
}
开发者ID:saper,项目名称:organic-extensions,代码行数:12,代码来源:page_props.example.php

示例10: onParserFirstCallInit

 public static function onParserFirstCallInit(Parser &$parser)
 {
     // When the parser sees the <sample> tag, it executes
     // the wfSampleRender function (see below)
     $parser->setHook('in', 'NumerAlpha::renderNumeralTag');
     $parser->setHook('ia', 'NumerAlpha::renderAlphaTag');
     $parser->setHook('ir', 'NumerAlpha::renderRomanTag');
     // Always return true from this function. The return value does not denote
     // success or otherwise have meaning - it just must always be true.
     self::$listTypes = array(wfMessage('ext-numeralpha-list-type-numeral')->text() => "numeral", wfMessage('ext-numeralpha-list-type-alpha')->text() => "alpha", wfMessage('ext-numeralpha-list-type-roman')->text() => "roman");
     $parser->setFunctionHook('counter', array('NumerAlpha', 'renderCounter'), SFH_OBJECT_ARGS);
     return true;
 }
开发者ID:emanspeaks,项目名称:mediawiki-extensions-NumerAlpha,代码行数:13,代码来源:NumerAlpha.class.php

示例11: onParserFirstCallInit

 public static function onParserFirstCallInit(Parser &$parser)
 {
     // Register the hook with the parser
     $parser->setHook('searchbox', array('SearchBoxesHooks', 'render'));
     // Continue
     return true;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-SearchBoxes,代码行数:7,代码来源:SearchBoxes.hooks.php

示例12: onParserFirstCallInit

 /**
  * @brief This function set parseTag hook
  */
 public static function onParserFirstCallInit(Parser &$parser)
 {
     wfProfileIn(__METHOD__);
     $parser->setHook(CHAT_TAG, array(__CLASS__, "parseTag"));
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:ChatEntryPoint.class.php

示例13: onParserFirstCallInit

 /**
  * @brief This function set renderTag hook
  * @param Parser parser
  * @return true
  */
 public function onParserFirstCallInit(Parser $parser)
 {
     wfProfileIn(__METHOD__);
     $parser->setHook('hubspopularvideos', array($this, 'renderTag'));
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:12,代码来源:WikiaHubsHook.class.php

示例14: onParserFirstCallInit

 /**
  * Sets up this extensions parser functions.
  *
  * @access	public
  * @param	object	Parser object passed as a reference.
  * @return	boolean	true
  */
 public static function onParserFirstCallInit(Parser &$parser)
 {
     foreach (self::$tags as $hook => $method) {
         $parser->setHook($hook, array(__CLASS__, $method));
     }
     return true;
 }
开发者ID:HydraWiki,项目名称:CharacterEscapes,代码行数:14,代码来源:CharacterEscapes.hooks.php

示例15: efWidgetTagSetup

/**
 * Setup parser hook
 *
 * @param Parser $parser
 * @return bool
 */
function efWidgetTagSetup(Parser $parser)
{
    global $wgHooks;
    $parser->setHook('widget', 'efWidgetTagRender');
    $wgHooks['ParserAfterTidy'][] = 'efWidgetTagReplaceMarkers';
    return true;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:13,代码来源:WidgetTag.php


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