uran1980 / yii2-bootstrap-markdown-editor
Yii2 Markdown Editor based on Bootstrap Markdown.
Installs: 291
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 3
Forks: 3
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/bootstrap-markdown: 2.*
- bower-asset/marked: *
- bower-asset/to-markdown: *
- uran1980/yii2-code-prettify: *
- uran1980/yii2-jquery-essential: *
- uran1980/yii2-textarea-autosize: *
- yiisoft/yii2: ~2
This package is auto-updated.
Last update: 2024-10-13 04:01:56 UTC
README
Yii2 Markdown Editor based on Bootstrap Markdown.
This component use folowing libraries:
- Marked -- a full-featured markdown parser and compiler, written in JavaScript.
- To markdown -- an HTML to Markdown converter written in javascript.
- Bootstrap Markdown -- JSimple Markdown editing tools that works!
Installation
Composer
The preferred way to install this extension is through Composer.
Either run
php composer.phar require uran1980/yii2-bootstrap-markdown-editor "dev-master"
or add
"uran1980/yii2-bootstrap-markdown-editor": "dev-master"
to the require section of your composer.json
Usage
Active widget
In view in active form:
<?php use yii\widgets\ActiveForm; use uran1980\yii\widgets\markdown\MarkdownEditor; ?> <div class="active-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'content')->widget(MarkdownEditor::className(), [ 'clientOptions' => ['language' => Yii::$app->language], 'options' => ['data-provider' => 'markdown'], ]); ?> <?php ActiveForm::end(); ?> </div>
Simple widget
In view:
<?php use uran1980\yii\widgets\markdown\MarkdownEditor; echo MarkdownEditor::widget([ 'name' => 'md-editor', 'value' => '# test message', 'clientOptions' => ['language' => Yii::$app->language], 'options' => ['data-provider' => 'markdown'], ]);
See also
Author
Ivan Yakovlev, e-mail: uran1980@gmail.com