В чем может быть проблема?
Ошибка:
Код: Выделить всё
Class 'yii\imagine\Image' not found
Код: Выделить всё
<?php
namespace app\controllers;
use yii;
use yii\web\Controller;
use yii\imagine\Image;
use Imagine\Image\Box;
class UpdateController extends Controller
{
public function actionIndex() {
$imagesrc = 'https://st4.depositphotos.com/9790088/24032/i/950/depositphotos_240323916-stock-photo-huai-mae-khamin-waterfall-tier4.jpg';
echo $this->UploadImage($imagesrc);
return;
}
private function UploadImage($file) {
$filename = Yii::$app->getSecurity()->generateRandomString(15).'.jpg';
$name_big = 'data/test/'.$filename;
Image::resize($file, 800, 800)
->save($name_big);
return $name_big;
}
}
Код: Выделить всё
'yii\\imagine\\' => array($vendorDir . '/yiisoft/yii2-imagine/src'),