This is someone else wrote a yii1 Baidu editor ueditor extension, webmaster I have used in their own projects, now record the usage and use of the problems.
Directory structure
Baiduueditor
|--resource//ueditor Resource Bundle
View of |--views//widget
|--config.php//Back-end configuration files include file format size directory path file name and so on
|--ueditorcontroller.php//back-end host controller can modify inheriting class to custom base class
|--ueditorwidget.php//widget main Render editor
|--uploader.class.php//uploading and other main processing classes
Use
1, copy the Baiduueditor to the protected/extensions/directory
2, add the following code to config/main.php
' Controllermap ' =>array (
' Ueditor ' =>array (
' Class ' => ' Ext.baiduUeditor.UeditorController ',
),
),
If you want to use only one module, add the following code to the Modules/modulename/modulenamemodule.php init method
$this->controllermap=array (
' Ueditor ' =>array (
' Class ' => ' Ext.baiduUeditor.UeditorController ',
),
);
Place the following code in the view where you want to display the editor
$this->widget (' Ext.baiduUeditor.UeditorWidget ',
Array
' ID ' => ' Article_content ',//container ID Unique [must be configured]
' Name ' => ' Content ',//post to background-received name [must be configured]
' Content ' => ',//initialize contents [OPTIONAL]
configuration options, [optional]
The Ueditor configuration items are passed in as array key-value pairs, specifically to view the Ueditor.config.js
Do not configure ServerURL (even if the configuration is overwritten) The program automatically processes the backend URL
' Config ' =>array (
' Toolbars ' =>array (Array (' fullscreen ', ' source ', ' | '),//toolbars note nested two arrays
' Lang ' => ' ZH-CN '
)
)
);
Following the steps above, the editor will definitely appear on the page without any surprises.
Problem: Upload pictures can not be reported, back-end configuration items do not load properly, upload plug-ins can not use the normal error.
Workaround: There is this ueditorcontroller.php file in the directory structure, please put this file in the Controller directory of your website, because upload the picture will eventually access to this file, my website access path is/admin/index.php?r= ueditor&action=config&&nocache=1464083990339, see this path should understand it. Do not understand in the group ask me! Group qq:66357155