I'm using this ckeditor extension for yii2 https://packagist.org/packages/wadeshuler/yii2-ckeditor-cdn
I created directories backend/web/uploads/images and gave them rights 777
I configured backend/config/main.php like this
'modules' => [
'ckeditor' => [
'class' => 'wadeshuler\ckeditor\Module', // required and dont change!!!
'uploadDir' => '@app/web/uploads', // must be file path (required when using filebrowser*BrowseUrl below)
'uploadUrl' => '@web/uploads', // must be valid URL (required when using filebrowser*BrowseUrl below)
// These are basically passed to the `CKEDITOR.replace()`
'widgetClientOptions' => [
'filebrowserImageBrowseUrl' => '/ckeditor/default/image-browse',
'filebrowserImageUploadUrl' => '/ckeditor/default/image-upload',
]
],
],
Put in the form
use wadeshuler\ckeditor\widgets\CKEditor;
<?= $form->field($model, 'body')->widget(CKEditor::className()) ?>
And when I upload an image and click "Send it to the server" it doesn't upload and when I click "ok" it says Image source URL is missing.
Maybe someone has faced this problem before? By the way, if I remove these lines
//'uploadDir' => '@app/web/uploads', // must be file path (required when using filebrowser*BrowseUrl below)
//'uploadUrl' => '@web/uploads', // must be valid URL (required when using filebrowser*BrowseUrl below)
Nothing is changed. The same mistake.