The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist cliff363825/yii2-kindeditor "*"
or add
"cliff363825/yii2-kindeditor": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
1) Without any model:
<?= \cliff363825\kindeditor\KindEditorWidget::widget([
'name' => 'content',
'options' => [], // html attributes
'clientOptions' => [
'width' => '680px',
'height' => '350px',
'themeType' => 'default', // optional: default, simple, qq
'langType' => \cliff363825\kindeditor\KindEditorWidget::LANG_TYPE_ZH_CN, // optional: ar, en, ko, ru, zh-CN, zh-TW
...
],
]); ?>
2) With an model:
<?= \cliff363825\kindeditor\KindEditorWidget::widget([
'model' => $model,
'attribute' => 'content',
'options' => [], // html attributes
'clientOptions' => [
'width' => '680px',
'height' => '350px',
'themeType' => 'default', // optional: default, simple, qq
'langType' => \cliff363825\kindeditor\KindEditorWidget::LANG_TYPE_ZH_CN, // optional: ar, en, ko, ru, zh-CN, zh-TW
...
],
]); ?>
You may have to modify your code in your project if
KindEditorWidget->clientOptions->langType
was setzh_CN
orzh_TW
.说简单点,就是你要把langType是
zh_CN
、zh_TW
对应改成zh-CN
、zh-TW
。
KindEditorUploadAction->savePath
is changed to uploads
now, NOT @webroot/uploads
.Add a new property
basePath
and the default value is@webroot
.
KindEditorUploadAction->saveUrl
.Add a new property
baseUrl
and the default value is@web
.
see the change log
For full details on usage, see the documentation.
htm, html
unsafe file extensions from KindEditorUploadAction
.KindEditor
version from 4.1.11 to 4.1.12.see the change log. mkdir()
mode 0755.KindEditor
version from 4.1.10 to 4.1.11.see the change log.KindEditorWidget::LANG_TYPE_ZH_CN
or LANG_TYPE_ZH_TW
to avoid this problem.KindEditorUploadAction->savePath
is changed to uploads
now, NOT @webroot/uploads
.basePath
and the default value is @webroot
.KindEditorUploadAction->saveUrl
.baseUrl
and the default value is @web
.KindEditorBaseController
to actions KindEditorUploadAction
,KindEditorFileManagerAction
KindEditorBaseController
is deprecated and will be removed in the future.KindEditorBaseController
is too long, use KindEditorController
instead.
Comments