private function generateImages($type) {
        $imagable = \Yii::$app->shop_imagable;

        $nameFile = (new Security())->generateRandomString();
        $this->$type->saveAs($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
        $image_name = $imagable->create('shop-category/' . $type,
            $imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
        unlink($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);

        return $image_name;
    }
private function generateImages($type) {
        $imagable = \Yii::$app->shop_imagable;

        $nameFile = (new Security())->generateRandomString();
        $this->$type->saveAs($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
        $image_name = $imagable->create('shop-category/' . $type,
            $imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);
        unlink($imagable->imagesPath . '/' . $nameFile . '.' . $this->$type->extension);

        return $image_name;
    }
private function generateImages ( $ type ) { $ imagable = \ Yii :: $ app -> shop_imagable ; $ nameFile = ( new Security ( ) ) -> generateRandomString ( ) ; $ this -> $ type -> saveAs ( $ imagable -> imagesPath . '/' . $ nameFile . '.' . $ this -> $ type -> extension ) ; $ image_name = $ imagable -> create ( 'shop-category/' . $ type , $ imagable -> imagesPath . '/' . $ nameFile . '.' . $ this -> $ type -> extension ) ; unlink ( $ imagable -> imagesPath . '/' . $ nameFile . '.' . $ this -> $ type -> extension ) ; return $ image_name ; }
Generates images from uploaded image using Imagable component

@param $type
@return mixed
Generates images from uploaded image using Imagable component