jodit / yii2-jodit
Jodit - awesome WYSIWYG Editor like widget for Yii2
Installs: 13 005
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 3
Forks: 4
Open Issues: 1
Type:yii2-extension
Requires
- jodit/application: ^2.0.11
- xdan/jodit: ^3.1.0
- yiisoft/yii2: ^2.0
- dev-master
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.5
- 1.0.4
- 1.0.2
- 1.0.1
- 1.0.0
This package is not auto-updated.
Last update: 2024-10-29 11:01:43 UTC
README
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, ], ],
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', ], ], ]);?>
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' ]);?>
License
This package is available under MIT
License.