PHP code example of zacksleo / yii2-ueditor
1. Go to this page and download the library: Download zacksleo/yii2-ueditor library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zacksleo / yii2-ueditor example snippets
use zacksleo\yii2\ueditor\assets\Editor135Asset;
Editor135Asset::register($this);
$this->registerJsFile('/admin/ueditor/i25/script',[
'depends'=>[
'kucha\ueditor\UeditorAsset'
]
]);
echo \kucha\ueditor\UEditor::widget([
'name' => 'ueditor',
'clientOptions' => [
//编辑区域大小
'initialFrameHeight' => '200',
//设置语言
'lang' => 'zh-cn', //中文为 zh-cn
'zIndex' => '9995',
//定制菜单
'toolbars' => [
[
'fullscreen', 'source', 'undo', 'redo', '|',
'fontsize',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
'forecolor', 'backcolor', '|',
'lineheight', '|',
'indent', '|', '135editor'
],
]
]
]);
use zacksleo\yii2\ueditor\assets\EditorXiumiAsset;
EditorXiumiAsset::register($this);
$this->registerJsFile('/admin/ueditor/xiumi/script',[
'depends'=>[
'kucha\ueditor\UeditorAsset'
]
]);
echo \kucha\ueditor\UEditor::widget([
'name' => 'ueditor',
'clientOptions' => [
//编辑区域大小
'initialFrameHeight' => '200',
//设置语言
'lang' => 'zh-cn', //中文为 zh-cn
'zIndex' => '9995',
//定制菜单
'toolbars' => [
[
'fullscreen', 'source', 'undo', 'redo', '|',
'fontsize',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
'forecolor', 'backcolor', '|',
'lineheight', '|',
'indent', '|', '135editor'
],
]
]
]);