Class kartik\markdown\Markdown

Available since version1.0

Markdown provides concrete implementation for PHP Markdown Extra and PHP SmartyPantsTypographer.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$markdown \Michelf\MarkdownExtra kartik\markdown\Markdown

Public Methods

Hide inherited methods

MethodDescriptionDefined By
convert() Converts markdown into HTML kartik\markdown\Markdown
customProcess() Custom conversion of patterns kartik\markdown\Markdown
process() Converts markdown into HTML kartik\markdown\Markdown


Hide inherited constants

ConstantValueDescriptionDefined By
SMARTYPANTS_ATTR_DO_NOTHING 0 kartik\markdown\Markdown
SMARTYPANTS_ATTR_EM_DASH 1 kartik\markdown\Markdown

Property Details

$markdown protected static property
protected static \Michelf\MarkdownExtra $markdown null

Method Details

convert() public static method

Converts markdown into HTML

public static string convert ( $content, $config = [], $smartyMode self::SMARTYPANTS_ATTR_LONG_EM_DASH_SHORT_EN )
$content string
$config array

. Options to configure MarkdownExtra and smarty

  • markdown: array for MarkdownExtra configuration parameters
  • smarty: array for SmartyPantsTypographer configuration parameters
  • custom: array for Custom configuration parameters
$smartyMode integer

The SmartyPantsTypographer processing mode

throws yii\base\InvalidConfigException

if module not set

customProcess() public static method

Custom conversion of patterns

public static string customProcess ( $content, $config = [] )
$content string
$config array

. List of key value pairs to find and replace

process() public static method

Converts markdown into HTML

public static string process ( $content, $config = [] )
$content string
$config array