weison-tech / yii2-imperavi-redactor
Imperavi Redactor WYSIWYG小部件(针对Yii 2的OEM许可)
0.0.2
2015-10-02 07:13 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-14 17:43:02 UTC
README
为 Experitus 创建
ImperaviRedactorWidget
是 Imperavi Redactor 的包装器,这是一个高质量的WYSIWYG编辑器。
请注意,Imperavi Redactor 本身是一个专有商业版权软件,但由于Yii社区购买了OEM许可,因此您可以在Yii中使用它而不必付费。
使用模型
yii\imperavi\Widget::widget([ // You can either use it for model attribute 'model' => $my_model, 'attribute' => 'my_field', // or just for input field 'name' => 'my_input_name', // Some options, see http://imperavi.com/redactor/docs/ 'options' => [ 'toolbar' => false, 'css' => 'wym.css', ], ]);
或者,您也可以通过调用将Redactor附加到已经存在的DOM元素
yii\imperavi\Widget::widget([ // Some options, see http://imperavi.com/redactor/docs/ 'options' => [], ]);
通过资源包插入的redactor插件。
yii\imperavi\Widget::widget([ 'options' => [ 'lang' => 'ru', ], 'plugins' => [ 'fullscreen', 'clips' ] ]);
安装
安装此扩展的首选方式是通过 composer。
运行
php composer.phar require asofter/yii2-imperavi-redactor "*"
或者在您的 composer.json
文件的require部分添加
"asofter/yii2-imperavi-redactor": "*"
。