pun2006/yii2-nicedit

Nicedit yii 小部件包装器。

1.2.2 2019-06-19 15:27 UTC

This package is auto-updated.

Last update: 2024-09-20 02:59:22 UTC


README

测试 wyswyg 编辑器小部件包装器 http://nicedit.com,用于编写小部件的学习。

该编辑器已被弃用。

安装

使用 php composer.phar require "pun2006/yii2-nicedit" "*"

使用

use pun2006\yiinicedit\NiceditWidget;
<?=  NiceditWidget::widget(['content' => "some content",'local'=>true]); ?>

也可以与 ActiveField 一起使用。

$form->field($model, 'attribute')->widget(NiceditWidget::classname(),['local'=>true]) ?>

选项

  • 支持以下选项
    • content, string 使用指定内容初始化,默认为空;
    • editorOptions, array wiki.nicedit.com
    • local, boolean 使用小部件的本地脚本,默认 false(使用 CDN 资源)。

示例

<?= $form->field($category, 'name')->widget(NiceditWidget::classname(),['local'=>true,'editorOptions'=>['buttonList'=>['bold','italic','underline','left','center']]]) ?>