wonail/yii2-markdown

Markdown Widget for Yii2

Installs: 100

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:yii2-extension

v0.1.1 2017-09-18 09:44 UTC

This package is not auto-updated.

Last update: 2024-04-28 02:32:24 UTC


README

Widget based on simplemde-markdown-editor

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist wonail/yii2-markdown "*"

or add

"wonail/yii2-markdown": "*"

to the require section of your composer.json.

Usage

Once the extension is installed, simply add widget to your page as follows:

  1. Usage with ActiveForm and model
<?= $form->field($model, 'content')->widget(\wonail\markdown\MarkdownEditor::class, [
    'editorOptions' => [
        'showIcons' => ["code", "table"],
        'spellChecker' => false,
    ],
]); ?>
  1. Usage without ActiveForm and model
<?= \wonail\markdown\MarkdownEditor::widget([
    'name' => 'markdown-editor',
    'editorOptions' => [
        'showIcons' => ["code", "table"],
        'autofocus' => true,
        'spellChecker' => false,
    ],
]);
?>

Markdown Editor Options

You can find them on the options page