zxbodya / yii2-tinymce
Yii2 extension to use TinyMce with Compressor and FileManager
Installs: 28 644
Dependents: 3
Suggesters: 1
Security: 0
Stars: 17
Watchers: 4
Forks: 10
Open Issues: 3
Type:yii2-extension
Requires
- yiisoft/yii2: *
Suggests
- zxbodya/yii2-elfinder: To add elFinder file manager
This package is not auto-updated.
Last update: 2024-11-09 16:58:38 UTC
README
Yii2 extension to simplify tinymce wyiwyg editor usage in your application.
Extension is based on Yii 1.1 version: https://github.com/zxbodya/yii-tinymce
Provides:
- widget
- compressor action
- stub for integration with file managers like elFinder
##Installation The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist zxbodya/yii2-tinymce "*@dev"
or add
"zxbodya/yii2-tinymce": "*@dev"
to the require section of your composer.json
file.
Usage
Widget basic usage
$form->field($model, 'content')->widget(TinyMce::className())
Scripts Compressor Action
This can be used to optimize widget loading time.
At fist setup compressor action:
public function actions() { return [ 'tinyMceCompressor' => [ 'class' => TinyMceCompressorAction::className(), ], ]; }
Next add route to configured action to widget ooptions:
$form->field($model, 'content')->widget( TinyMce::className(), ['compressorRoute' => 'test/tinyMceCompressor'] )
ElFinder Fille manager
At fisrt install zxbodya/yii2-elfinder
extesion.
https://github.com/zxbodya/yii2-elfinder
And configure connector action for it.
Next add file manager settings to widget:
$form->field($model, 'content')->widget( TinyMce::className(), [ 'fileManager' => [ 'class' => TinyMceElFinder::className(), 'connectorRoute' => 'el-finder/connector', ], ] )
Spellchecker
TinyMce has bundled plugin for spellchecking but it requires backed to work...
You can use yandex spellchecker service.
$form->field($model, 'content')->widget( TinyMce::className(), ['spellcheckerUrl'=>'http://speller.yandex.net/services/tinyspell'] )
More info about it here:
http://api.yandex.ru/speller/doc/dg/tasks/how-to-spellcheck-tinymce.xml
Or you can build own spellcheking service using code provided by moxicode: http://www.tinymce.com/download/download.php