I
I
Igor Lavrov2019-01-24 14:03:03
Yii
Igor Lavrov, 2019-01-24 14:03:03

How to get rid of the error when loading mutifiles?

Did according to the lesson - https://www.youtube.com/watch?v=7Am2TFBeCXw&index=...
The error itself:

Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: common\models\ImageManager::class()' 
in /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /var/www/www-homepro/data/www//core/common/models/ImageManager.php(49): yii\base\Component->__call('class', Array)
#1 [internal function]: common\models\ImageManager->common\models\{closure}(Object(common\models\ImageManager), 'sort')
#2 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/validators/DefaultValueValidator.php(48): call_user_func(Object(Closure), Object(common\models\ImageManager), 'sort')
#3 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/validators/Validator.php(267): yii\validators\DefaultValueValidator->validateAttribute(Object(common\models\ImageManager), 'sort')
#4 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(common\models\ImageManager), Array)
#5 /var/www/www-homepro/data/www//core/backend/controllers/SiteController.php(112): yii\base\Model->validate()
#6 [internal function]: backend\controllers\SiteController->actionSaveImg()
#7 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#8 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#9 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('save-img', Array)
#10 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('site/save-img', Array)
#11 /var/www/www-homepro/data/www//core/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#12 /var/www/www-homepro/data/www//admin/index.php(17): yii\base\Application->run()
#13 {main}

What is the problem I can't understand.
If I understand correctly, he swears at this part
public function getImagesLinksData()
    {
        return ArrayHelper::toArray($this->images,[
            ImageManager::className() => [
                'caption' => 'name',
                'key' => 'id',
            ]]
        );
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-01-24
@Maky_e0

try to
write
PS instead: it would be nice to indicate the version of php and yii in such questions, so there are nuances

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question