Yii2 markdown parser and editor
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist altiore/yii2-markdown "*"
or add
"altiore/yii2-markdown": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
- Convert markdown to html:
<?= \altiore\yii2\markdown\Markdown::convert($markdownText); ?>
- Editor markdown in yii2 form:
<?= $form->field($model, 'text')->widget(\altiore\yii2\markdown\MarkdownEditor::class) ?>