Q
Q
qorp2016-04-14 17:32:14
PHP
qorp, 2016-04-14 17:32:14

How to set up multiple image uploads for users in ckeditor?

Hello! For the third day I have not configured the loading of images in ck-editor. Loaded extension
MihailDev/yii2-ckeditor , standard widget. It remains to configure it for loading images. I display _form.php

echo $form->field($model, 'body')->widget(CKEditor::className(), [
        'editorOptions' => [
            'filebrowserImageUploadUrl'=> Yii::$app->urlManager->createUrl(['/file-storage/ck-upload']),
            'preset'=>'basic',
            ],
    ]);

Created an action that outputs a string
<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction('$funcNum', '{$output['fileName']}', '$message');</script>"

all variables are in place, the file is uploaded to the server, but instead of displaying it in the editor after the upload is completed, it displays the following under the button
944f6895c8b8464c8557cba2916e931b.png
i.e. what I return from the server. We need the ability to upload images to an article for users with the ability to select multiple files, but here you can’t figure out what’s going on with just one. Please help, maybe there is another solution. Tried with imperavi but it doesn't have multiboot, the new version has it but it hasn't appeared in yii2 yet.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question