Answer the question
In order to leave comments, you need to log in
Two models for uploading an image on Yii2 with vova07/yii2-fileapi-widget?
Who used this widget to upload images? The question is, how to set Actions in the controller if there is more than one model?
An example of part of the controller code:
<?php
namespace frontend\controllers;
...
use vova07\fileapi\actions\UploadAction as FileAPIUpload;
use common\models\category\Category;
use common\models\company\Company;
...
class SiteController extends Controller
{
public function actions()
{
return [
...
'fileapi-upload' => [
'class' => FileAPIUpload::className(),
'path' => Category::AVATAR_UPLOAD_TEMP_PATH, // все работает ок
],
'fileapi-upload' => [
'class' => FileAPIUpload::className(),
'path' => Company::AVATAR_UPLOAD_TEMP_PATH, // дублировал для примера, что по-отдельности работают ок, но как использовать две и более моделей в контроллере, чтобы работали вместе?
],
];
}
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question