sim2github/yii2-imperavi-module

Yii2 框架的 Redactor 模块。

安装: 211

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 1

分支: 93

开放问题: 0

语言:JavaScript

类型:yii2-extension

dev-master 2014-08-17 09:32 UTC

This package is not auto-updated.

Last update: 2019-09-29 02:25:31 UTC


README

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

php composer.phar require sim2github/yii2-imperavi-module "dev-master"

"sim2github/yii2-imperavi-module": "*"

将以下内容添加到您的 composer.json 文件的 require 部分中。

使用图像和文件操作

将 redactor 模块添加到您的配置中

'modules' => [
        'redactor' =>  'sim2github\imperavi\Module',
],

ActiveForm 使用

		$form->field($model, 'content')->widget(sim2github\imperavi\widgets\Redactor::className(), [
			'options' => [
				'debug' => 'true',
			],
			'clientOptions' => [ // [More about settings](http://imperavi.com/redactor/docs/settings/)
				'convertImageLinks' => 'true', //By default
				'convertVideoLinks' => 'true', //By default
				//'wym' => 'true',
				//'air' => 'true',
				'linkEmail' => 'true', //By default
				'lang' => 'ru',
				'imageGetJson' =>  \Yii::getAlias('@web').'/redactor/upload/imagejson', //By default
				'plugins' => // [More about plugins](http://imperavi.com/redactor/plugins/)
					'ace',
					'clips', 
					'fullscreen'
				],
			],

		])

您可以扩展 sim2github\imperavi\widgets\Redactor 并覆盖 init 函数来自定义默认设置。

自定义插件

  • Ace 代码编辑器,类似于 GitHub。带有 Emmet 扩展。

资产源

模块使用 redactor 的最新版本 https://github.com/yiiext/imperavi-redactor-widget。Yii2 和 Imperavi-redactor 的重大更改可能会破坏某些功能。