wangningkai / yii2-markdown-editor
Yii2 Markdown Editor
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
This package is auto-updated.
Last update: 2024-10-27 15:26:04 UTC
README
优秀的Markdown编辑器 Markdown Editor For Yii2
安装
建议通过 composer进行安装.
命令行安装
php composer.phar require --prefer-dist yiier/yii2-editor.md "*"
在 composer.json
文件中引入
"yiier/yii2-editor.md": "*"
使用
安装完成后, 复制一下代码到需要使用的地方:
<?php use yii\helpers\Html; use yii\bootstrap\ActiveForm; use WangNingkai\MarkdownEditor\MarkdownEditorWidget; ?> <?= $form->field($model, 'content')->widget(MarkdownEditorWidget::className(), [ 'options'=>[// html attributes 'id'=>'content' ], 'clientOptions' => [ 'imageUpload' => true, 'imageFormats' => ['jpg', 'jpeg', 'gif', 'png', 'bmp', 'webp'], 'imageUploadURL' => '/Action/to/upload', ] ] ) ?>