Skip to content
Jodit widget for Yii2
Branch: master
Clone or download
xdan Merge pull request #3 from stkevich/master
fix fileRemove and folderRemove URL
Latest commit 465e272 Nov 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
screens New version 1.1.5. Read more http://xdsoft.net/jodit/doc/index.html#1… Feb 15, 2018
src fix fileRemove and folderRemove URL Oct 2, 2018
LICENSE Initial commit Dec 8, 2017
README.md New version 1.1.5. Read more http://xdsoft.net/jodit/doc/index.html#1… Feb 15, 2018
composer.json New version 1.1.8. Read more http://xdsoft.net/jodit/doc/index.html#1… Feb 26, 2018
package.json

README.md

yii2-jodit

Jodit widget for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist jodit/yii2-jodit "*"

or

composer require --prefer-dist jodit/yii2-jodit

or add

"jodit/yii2-jodit": "*"

to the require section of your composer.json file.

Configure

Add to config file (config/web.php or common\config\main.php)

'modules' => [
	'jodit' => 'yii2jodit\JoditModule',
],

or if you want to change the upload directory. to path/to/uploadfolder default value @webroot/uploads

'modules' => [
	'jodit' => [
		'class' => 'yii2jodit\JoditModule',
		'extensions'=>['jpg','png','gif'],
		'root'=> '@webroot/uploads/',
		'baseurl'=> '@web/uploads/',
		'maxFileSize'=> '20mb',
		'defaultPermission'=> 0775,
	],
],

All connector's options

note: You need to create uploads folder and chmod and set security for folder upload reference:Protect Your Uploads Folder with .htaccess, []How to Setup Secure Media Uploads](http://digwp.com/2012/09/secure-media-uploads/)

Usage

Once the extension is installed, simply use it in your code by :

<?=$form->field($model, 'content')->widget(\yii2jodit\JoditWidget::className(), [
    'settings' => [
        'buttons'=>[
            'bold', 'italic', 'underline', '|', 'ul', 'ol', '|', 'image', '|', 'hr',
        ],
    ],
]);?>

All Jodit's options

or not use ActiveField

<?= \yii2jodit\JoditWidget::widget([
    'model' => $model,
    'attribute' => 'content'
]) ?>

Image uploader

editors config:

<?=$form->field($model, 'content')->widget(\yii2jodit\JoditWidget::className(), [
    'settings' => [
        'height'=>'250px',
        'enableDragAndDropFileToEditor'=>new \yii\web\JsExpression("true"),
    ],
]);?>

Icon Picker

<?=$form->field($model, 'icon')->widget(\yii2jodit\JoditIconPickerWidget::className(), [
	"path" => 'wp-content/plugins/exchangers-monitor/images/systemlogo'
]);?>

Icon Picker

License

This package is available under MIT License.

You can’t perform that action at this time.