W3cubDocs

/Yii 2.0

Class yii\helpers\Markdown

Inheritance yii\helpers\Markdown » yii\helpers\BaseMarkdown
Available since version 2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/helpers/Markdown.php

Markdown provides an ability to transform markdown into HTML.

Basic usage is the following:

$myHtml = Markdown::process($myText); // use original markdown flavor
$myHtml = Markdown::process($myText, 'gfm'); // use github flavored markdown
$myHtml = Markdown::process($myText, 'extra'); // use markdown extra

You can configure multiple flavors using the $flavors property.

For more details please refer to the Markdown library documentation.

Public Properties

Property Type Description Defined By
$defaultFlavor string The markdown flavor to use when none is specified explicitly. yii\helpers\BaseMarkdown
$flavors array A map of markdown flavor names to corresponding parser class configurations. yii\helpers\BaseMarkdown

Public Methods

Method Description Defined By
process() Converts markdown into HTML. yii\helpers\BaseMarkdown
processParagraph() Converts markdown into HTML but only parses inline elements. yii\helpers\BaseMarkdown

Protected Methods

Method Description Defined By
getParser() yii\helpers\BaseMarkdown

© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-helpers-markdown.html