yidashi / yii2-bootstrap-markdown
yii2-boostrap-markdown
Installs: 1 567
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 1
Forks: 4
Language:JavaScript
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2018-05-09 18:41:10 UTC
README
composer require yidashi/yii2-bootstrap-markdown:"*"
2.使用
直接使用
<?= \yidashi\markdown\Markdown::widget(['name' => 'xxx', 'language' => 'zh'])?>
或者在activeForm里使用
<?= $form->field($model,'attributeName')->widget('yidashi\markdown\Markdown',['language' => 'zh']); ?>
语言参数language默认就是zh,可以不提供
如果需要上传图片功能,加useUploadImage => true
,此功能依赖 yidashi/yii2-webuploader
,见https://github.com/yidashi/yii2-webuploader
3.解析
<?= yii\helpers\Markdown::process($content, 'gfm')?>