H
H
hollanditkzn2017-03-21 15:45:01
Yii
hollanditkzn, 2017-03-21 15:45:01

How can I send the specified data to the database?

I stood up. There is a form for sending data, creating a record. There is no status field in the sending form itself, because when adding it, it should default to "new", and so it goes empty. Where it is necessary to write it in model the table or in other place?
And the second point is also not to list who accepted the order, and the account that added the order should be logged into the database.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-03-21
@hollanditkzn

Good afternoon.
You need to read the documentation.
You have to learn to ask questions.
You need to accustom yourself to supplement the question with your code, and not wait for a ready-made solution.
Although I will tell you one (!) Of the options. You yourself think about where you need to place it, for reference, read the documentation.

public function rules(){
  return [
     ['status', 'default', 'value' => 'Новый']
  ]
}

PS
Start by studying the materials of the official documentation and the materials of this most interesting blog .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question