omcrn / yii2-imperavi-redactor
Imperavi Redactor WYSIWYG小部件(为Yii 2提供OEM授权)
0.0.4
2017-05-22 12:14 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-24 17:44:20 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 "*"
或
"asofter/yii2-imperavi-redactor": "*"
将以下内容添加到您的composer.json
文件的require部分。