本文整理汇总了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();
}
示例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();
}
示例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');
}
}