S
S
Sergey Melnikov2015-10-22 16:32:58
Yii
Sergey Melnikov, 2015-10-22 16:32:58

Why is the field not available from the model?

Tell me plz.
I'm in the model, in the rules I attributed the fields to required. After model->load in the controller, they are available as model->pole , if not registered, they are not available, why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HaruAtari, 2015-10-22
@azazel_live

load() only works on the fields you specify for the current scenario. If you do not specify a script explicitly, then only those fields for which validation rules are specified are used. Read about scripting here: www.yiiframework.com/doc-2.0/guide-structure-model...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question