model->attributes in Yii2 always has NULL value
I have one temporary model as viewModel. In my CRUD actions (for example actionCreate) I want to get this viewModel data and assign that to a ActiveRecord model. I used below code but my model object atrribute always show NULL value for attributes: $model = new _Users(); if ($model->load(Yii::$app->request->post())) { Yii::info($model->attributes,'test'); // NULL $attributesValue =[ 'title' => $_POST['_Users']['title'], 'type' => $_POST['_Users']['type'], ]; $model->attributes = $attributesValue; Yii::info($model->attributes,'test'); // NULL $dbModel = new Users(); $dbModel->title = $model-