audriusdob / yii2-imperavi-redactor
Imperavi Redactor WYSIWYG小部件(为Yii 2 OEM许可)
dev-master
2015-10-01 14:39 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-14 17:42:56 UTC
README
为 Tourista 创建
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部分。