generateGuideUrl() public method

Generate an url to a guide page
public generateGuideUrl ( string $file ) : string
$file string
return string
コード例 #1
0
ファイル: ApiMarkdown.php プロジェクト: aivavic/yii2
 /**
  * @inheritdoc
  */
 protected function parseLink($markdown)
 {
     list($result, $skip) = parent::parseLink($markdown);
     // add special syntax for linking to the guide
     $result = preg_replace_callback('/href="guide:([A-z0-9-.#]+)"/i', function ($match) {
         return 'href="' . static::$renderer->generateGuideUrl($match[1]) . '"';
     }, $result, 1);
     return [$result, $skip];
 }
コード例 #2
0
ファイル: ApiMarkdown.php プロジェクト: tonylow/skillslink
 /**
  * @inheritdoc
  */
 protected function renderLink($block)
 {
     $result = parent::renderLink($block);
     // add special syntax for linking to the guide
     $result = preg_replace_callback('/href="guide:([A-z0-9-.#]+)"/i', function ($match) {
         return 'href="' . static::$renderer->generateGuideUrl($match[1]) . '"';
     }, $result, 1);
     return $result;
 }