uran1980/yii2-bootstrap-markdown-editor Yii2 Markdown Editor based on Bootstrap Markdown.

widgetseditormarkdowngfmyii2-bootstrap-markdown-editorbootstrapmarkdown

Yii2 Bootstrap Markdown Editor

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

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.0.4 is the latest of 4 releases



MIT license
Stats
5 github stars & 3 github forks
0 downloads in the last day
0 downloads in the last 30 days
291 total downloads