hector68 / yii2-grafikart-markdown-editor
Markdown editor with opportunity to uploading images
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 1
Language:JavaScript
Type:yii2-extension
Requires
- php: >=5.5.0
- bower-asset/dropzone: ~3.11.1
- bower-asset/marked: ~0.3.2
- bower-asset/underscore: ~1.7.0
- cebe/markdown: ~1.0.0 | ~1.1.0
- yiisoft/yii2: ^2.0.6
This package is not auto-updated.
Last update: 2024-10-26 19:26:58 UTC
README
base on https://github.com/Grafikart/JS-Markdown-Editor js widget
About Markdown:
Installation
php composer.phar require --prefer-dist hector68/yii2-grafikart-markdown-editor
or add
"hector68/yii2-grafikart-markdown-editor" : "^0.1"
o the require section of your composer.json file.
if need upload images on server when include module to your config
'modules' => [ 'markdown-editor' => [ 'class' => 'Hector68\GrafikartMarkdownEditor\Module', 'uploadDir' => '@webroot/images/markdown', 'isFileNameUnique' => true, //set unique name or use base name, 'maxSize' => 2097152, // in bites, Default 2mb 'expansions' => ['jpg', 'png'] ], ], ...
Form
<?= $form->field($model, 'firstMessage')->widget(Hector68\GrafikartMarkdownEditor\widgets\MdEditor::className(), [ 'uploader' => Url::to(['markdown-editor/upload/data']), //or false. Default false 'preview' => true, // default false, 'jsOptions' => [], // js options of widget. See https://github.com/Grafikart/JS-Markdown-Editor, 'images' => [], //Default images See https://github.com/Grafikart/JS-Markdown-Editor, ]) ?>
Render
$parser = new cebe\markdown\Markdown(); echo $parser->parse($model->firstMessage);