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


PHP Linker::commentLocal方法代码示例

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


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

示例1: formatLinksInComment

 /**
  * Formats wiki links and media links in text; all other wiki formatting
  * is ignored
  *
  * @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser
  * @param $comment String: text to format links in
  * @param $title An optional title object used to links to sections
  * @param $local Boolean: whether section links should refer to local page
  * @return String
  */
 public static function formatLinksInComment($comment, $title = null, $local = false)
 {
     self::$commentContextTitle = $title;
     self::$commentLocal = $local;
     $html = preg_replace_callback('/\\[\\[:?(.*?)(\\|(.*?))*\\]\\]([^[]*)/', array('Linker', 'formatLinksInCommentCallback'), $comment);
     self::$commentContextTitle = null;
     self::$commentLocal = null;
     return $html;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:19,代码来源:Linker.php

示例2: formatLinksInComment

    /**
     * Formats wiki links and media links in text; all other wiki formatting
     * is ignored
     *
     * @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser
     * @param $comment String: text to format links in
     * @param $title Title|null An optional title object used to links to sections
     * @param $local Boolean: whether section links should refer to local page
     * @return String
     */
    public static function formatLinksInComment($comment, $title = null, $local = false)
    {
        self::$commentContextTitle = $title;
        self::$commentLocal = $local;
        $html = preg_replace_callback('/
				\\[\\[
				:? # ignore optional leading colon
				([^\\]|]+) # 1. link target; page names cannot include ] or |
				(?:\\|
					# 2. a pipe-separated substring; only the last is captured
					# Stop matching at | and ]] without relying on backtracking.
					((?:]?[^\\]|])*+)
				)*
				\\]\\]
				([^[]*) # 3. link trail (the text up until the next link)
			/x', array('Linker', 'formatLinksInCommentCallback'), $comment);
        self::$commentContextTitle = null;
        self::$commentLocal = null;
        return $html;
    }
开发者ID:seedbank,项目名称:old-repo,代码行数:30,代码来源:Linker.php


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