我正在为yii2 https://packagist.org/packages/wadeshuler/yii2-ckeditor-cdn使用此计时器扩展
我创建了目录backend/web/uploads/images并为它们赋予了权限777
我像这样配置了backend/config/main.php
'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',
]
],
],在表格中填写
use wadeshuler\ckeditor\widgets\CKEditor;
<?= $form->field($model, 'body')->widget(CKEditor::className()) ?>当我上传一张图片并点击"Send it to the server“时,它没有上传,而当我点击"ok”时,它显示图片源URL缺失。
也许有人以前遇到过这个问题?顺便说一下,如果我删除这些行
//'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)什么都没有改变。同样的错误。
https://stackoverflow.com/questions/47547110
复制相似问题