从github上下载redactor:https://github.com/yiidoc/yii2-redactor
可以根据自己的需要放到相应的目录下,一般我们在vender下新建一个yiidoc目录,把下载好的yii2-redactor包放进来
‘modules’ => [
‘redactor’ => [
‘class’ => ‘yii\redactor\RedactorModule’,
‘uploadDir’ => ‘上传目录’,
‘uploadUrl’ => ‘图片可访问地址’,
‘imageAllowExtensions’=>[‘jpg’,‘png’,‘gif’]
],
],
根据自己的需要配置,官方文档都有
‘yiidoc/yii2-redactor’ =>
array (
‘name’ => ‘yiidoc/yii2-redactor’,
‘version’ => ‘10.1.1’,
‘alias’ =>
array (
‘@yii/redactor’ => $vendorDir . ‘/yiidoc/yii2-redactor’,
),
),
这个只是一个例子,根据实际目录情况配置
根据自己需要尽情的在view中使用吧,文档很多,不一一列举了