Bad Request (#400)
Unable to verify your data submission.
The above error occurred while the Web server was processing your request.
Please contact us if you think this is a server error. Thank you.
выключал: public $enableCsrfValidation = false; не помогает, Bad Request (#400) но перехватить данные не получается.
action
Код: Выделить всё
public function actionCreate()
{
$model = new TagTrack();
$modelFile = new TrackUpload();
if ($model->load(Yii::$app->request->post()) && $model->validate())
{
$file = UploadedFile::getInstance($modelFile, 'file');
var_dump($file) or exit;
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
'modelFile' => $modelFile,
]);
}
Код: Выделить всё
<?php
namespace app\models;
use yii\base\model;
class TrackUpload extends Model
{
public $file;
}
?>