S
S
Snewer2016-06-09 14:49:17
Yii
Snewer, 2016-06-09 14:49:17

Why are the script rules not working?

Hello!
There is a Users model. It has two scenarios:

const SCENARIO_NEW = self::SCENARIO_DEFAULT;
const SCENARIO_EDIT = 'edit';

SCENARIO_EDIT is not associated with any rule. The SCENARIO_NEW script is specified for the password attribute.
When specifying the SCENARIO_EDIT script, no validation occurs at all. What could be the reason? It is necessary that the validation pass through all fields except password.
ps There are no scripts for attributes.
pss The scenarios method is not overridden.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
amstr1k, 2016-06-09
@amstr1k

www.yiiframework.com/doc-2.0/guide-structure-model... read here and see if everything is so

P
Pavel Alexandrov, 2016-06-09
@inblank

In Russian, you can read here https://github.com/yiisoft/yii2/blob/master/docs/g...
In general, Yii2 throws out InvalidParamException exception.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question