0

Установил расширение Nemmo/yii2-attachments, и настроил все по инструкции, но при миграции выдает ошибку что модуль не найден. Вот лог ошибки

Exception 'Exception' with message 'Yii2 attachment module not found, may be you didn't add it to your config?'

in D:\OpenServer\domains\univer.lc\vendor\nemmo\yii2-attachments\src\ModuleTrait.php:30

Моя конфигурация app\config\web.php

'modules' => [
        'attachments' => [
            'class' => nemmo\attachments\Module::className(),
            'tempPath' => '@app/upload/file/temp',
            'storePath' => '@app/upload/file/store',
            'rules' => [ // Rules according to the FileValidator
                'maxFiles' => 10, // Allow to upload maximum 3 files, default to 3
                'mimeTypes' => 'image/png', // Only png images
                'maxSize' => 1024 * 1024 // 1 MB
            ],
            'tableName' => '{{%attachments}}' // Optional, default to 'attach_file'
        ],

Файл app\config\console.php

'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationNamespaces' => [
                'nemmo\attachments\migrations',
            ],
        ],
    ],

Скажите, что я делаю не так?

1 ответ 1

0

Чтобы все работало нужно добавить модуль attachments в config/console.php

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.