當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Markdown::processParagraph方法代碼示例

本文整理匯總了PHP中yii\helpers\Markdown::processParagraph方法的典型用法代碼示例。如果您正苦於以下問題:PHP Markdown::processParagraph方法的具體用法?PHP Markdown::processParagraph怎麽用?PHP Markdown::processParagraph使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\helpers\Markdown的用法示例。


在下文中一共展示了Markdown::processParagraph方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: directTypo

 /**
  * Process $text using settings without explode \n to <p>
  * $ntext = true change \n to <br>
  * @param $text
  * @param bool $ntext
  * @return string
  */
 public function directTypo($text)
 {
     $t = $this->Setup();
     $text = Markdown::processParagraph($text, $this->markdownType);
     $t->set_text($text);
     return $t->apply();
 }
開發者ID:andrew72ru,項目名稱:yii2-typographer,代碼行數:14,代碼來源:Typographer.php

示例2: run

 public function run()
 {
     if ($this->hasModel()) {
         $tagOptions = ArrayHelper::merge($this->options, ['id' => $this->targetId, 'class' => $this->clientOptions['class'] ?: '', 'data' => ['target' => $this->options['id']]]);
         if (isset($this->clientOptions['inline'])) {
             $value = Markdown::processParagraph(Html::getAttributeValue($this->model, $this->attribute));
             echo Html::tag($this->clientOptions['tag'] ?: 'p', $value, $tagOptions);
         } else {
             $value = MarkdownExtra::defaultTransform(Html::getAttributeValue($this->model, $this->attribute));
             echo Html::tag('section', Html::tag($this->clientOptions['tag'] ?: 'p', $value), $tagOptions);
         }
         echo Html::activeHiddenInput($this->model, $this->attribute);
     }
     $this->registerPlugin();
 }
開發者ID:andrew72ru,項目名稱:yii2-pen,代碼行數:15,代碼來源:Pen.php

示例3: process

 /**
  * Converts markdown into HTML
  *
  * @param string $content
  * @param TypeDoc $context
  * @param boolean $paragraph
  * @return string
  */
 public static function process($content, $context = null, $paragraph = false)
 {
     if (!isset(Markdown::$flavors['api-latex'])) {
         Markdown::$flavors['api-latex'] = new static();
     }
     if (is_string($context)) {
         $context = static::$renderer->apiContext->getType($context);
     }
     Markdown::$flavors['api-latex']->renderingContext = $context;
     if ($paragraph) {
         return Markdown::processParagraph($content, 'api-latex');
     } else {
         return Markdown::process($content, 'api-latex');
     }
 }
開發者ID:trntv,項目名稱:yii2,代碼行數:23,代碼來源:ApiMarkdownLaTeX.php


注:本文中的yii\helpers\Markdown::processParagraph方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。