项目作者: e-kevin

项目描述 :
Markdown Widget for Yii2
高级语言: PHP
项目地址: git://github.com/e-kevin/yii2-markdown.git
创建时间: 2017-09-18T04:42:19Z
项目社区:https://github.com/e-kevin/yii2-markdown

开源协议:BSD 3-Clause "New" or "Revised" License

下载


Markdown Widget for Yii2

Widget based on simplemde-markdown-editor

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

  1. "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

  1. <?= $form->field($model, 'content')->widget(\wonail\markdown\MarkdownEditor::class, [
  2. 'editorOptions' => [
  3. 'showIcons' => ["code", "table"],
  4. 'spellChecker' => false,
  5. ],
  6. ]); ?>

2) Usage without ActiveForm and model

  1. <?= \wonail\markdown\MarkdownEditor::widget([
  2. 'name' => 'markdown-editor',
  3. 'editorOptions' => [
  4. 'showIcons' => ["code", "table"],
  5. 'autofocus' => true,
  6. 'spellChecker' => false,
  7. ],
  8. ]);
  9. ?>

Markdown Editor Options

You can find them on the options page