Jodit in Yii2

Jodit widget for Yii2



The preferred way to install this extension is through composer.

Either run

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


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

or add

"jodit/yii2-jodit": "*"

to the require section of your composer.json file.


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',
'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](


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

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

All Jodit's options

or not use ActiveField

echo \yii2jodit\JoditWidget::widget([
    'model' => $model,
    'attribute' => 'content'

Image uploader

editors config:

echo $form->field($model, 'content')->widget(\yii2jodit\JoditWidget::className(), [
    'settings' => [
        'enableDragAndDropFileToEditor'=>new \yii\web\JsExpression("true"),

Icon Picker

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

Icon Picker


This package is available under MIT License.