B
B
Boris Yakushev2016-07-31 18:09:23
Yii
Boris Yakushev, 2016-07-31 18:09:23

Images not showing in choose, vova07/yii2-imperavi-widget?

Good afternoon.
Tell me, please, what am I doing wrong?
According to the documentation , I installed the editor, it works fine, but it does not display images in choose.
I upload them to blog.dev/frontend/web/uploads folder
Added to blog.dev/frontend/controllers/PostController.php

public function actions()
    {
        return [
            'images-get' => [
                'class' => 'vova07\imperavi\actions\GetAction',
                'url' => '/uploads',
                'path' => '@webroot/uploads',
                'type' => GetAction::TYPE_IMAGES,
            ],
            'image-upload' => [
                'class' => 'vova07\imperavi\actions\UploadAction',
                'url' => '/uploads',
                'path' => '@webroot/uploads',
            ],
        ];
    }

GetAction::TYPE_IMAGES, listed as \vova07\imperavi\actions\GetAction::TYPE_IMAGES
In blog.dev/frontend/views/post/_form.php
<?= $form->field($model, 'content')->widget(
    Widget::className(), [
        'settings' => [
            'lang' => 'ru',
            'minHeight' => 300,
            'imageUpload' => Url::to(['/post/image-upload']),
            'imageManagerJson' => Url::to(['/post/image-get']),
            'plugins' => [
                'fullscreen',
                'table',
                'video',
                'fontsize',
                'fontfamily',
                'imagemanager',
            ]
        ]
    ]
) ?>

When clicking on the "Image" icon, an error appears in the console:
0ad5a53feb.png
Previously uploaded images are not displayed on the choose tab.
Thank you very much for your advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-07-31
@za4me

s missed

'imageManagerJson' => Url::to(['/post/image-get']),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question