vollossy/imperavi-redactor-widget

此包的最新版本(dev-master)没有可用的许可证信息。

红色编辑器富文本编辑器的 Yii 小部件

安装: 16

依赖: 0

建议者: 0

安全: 0

星级: 0

关注者: 2

分支: 152

语言:JavaScript

dev-master 2013-08-14 13:19 UTC

This package is not auto-updated.

Last update: 2024-09-24 05:24:43 UTC


README

ImperaviRedactorWidgetImperavi Redactor 的包装器,一个高质量的 WYSIWYG 编辑器。

注意,Imperavi Redactor 本身是专有商业版权软件,但由于 Yii 社区购买了 OEM 许可证,您可以在 Yii 中免费使用。

用法

首先,导入小部件类文件

Yii::import('ext.imperavi-redactor-widget.ImperaviRedactorWidget');

然后,调用小部件

$this->widget('ImperaviRedactorWidget', array(
	// 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' => array(
		'lang' => 'ru',
		'toolbar' => false,
		'iframe' => true,
		'css' => 'wym.css',
	),
));

或者,您也可以通过调用将 Redactor 附接到现有的 DOM 元素

$this->widget('ImperaviRedactorWidget', array(
	// The textarea selector
	'selector' => '.redactor',
	// Some options, see http://imperavi.com/redactor/docs/
	'options' => array(),
));

通过资源包安装的 redactor 插件。

$this->widget('ImperaviRedactorWidget', array(
	'selector' => '.redactor',
	'options' => array(
		'lang' => 'ru',
	),
	'plugins' => array(
		'fullscreen' => array(
			'js' => array('fullscreen.js',),
		),
		'clips' => array(
			// You can set base path to assets
			'basePath' => 'application.components.imperavi.my_plugin',
			// or url, basePath will be ignored.
			// Defaults is url to plugis dir from assets
			'baseUrl' => '/js/my_plugin',
			'css' => array('clips.css',),
			'js' => array('clips.js',),
			// add depends packages
			'depends' => array('imperavi-redactor',),
		),
	),
));