Skip to content

Commit

Permalink
Additional docs related to the form validation rules. Added docs for…
Browse files Browse the repository at this point in the history
… scenario blacklisting ($off).
  • Loading branch information
resurtm committed Jul 28, 2012
1 parent 7b79e8e commit d500a46
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/guide/form.model.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ a list of scenarios where the rule should be applied; and additional options
are name-value pairs which are used to initialize the corresponding validator's
property values.

Since version 1.1.11 it is possible to blacklist scenarios. If you want
not to perform validation for some rule when particular scenarios are active
you could specify `off` parameter with their names. Syntax is the same
as for `on` parameter.

List of scenarios (`on` and `off` parameters) could be specified in two
different forms which means the same:

~~~
[php]
// arbitary array with scenario names
'on'=>array('update', 'create'),
// string with scenario names separated with commas (spaces are ignored)
'off'=>'ignore, this, scenarios, at-all',
~~~

There are three ways to specify `Validator` in a validation rule. First,
`Validator` can be the name of a method in the model class, like
`authenticate` in the above example. The validator method must be of the
Expand Down

0 comments on commit d500a46

Please sign in to comment.