HTML_QuickForm::addGroupRule()

HTML_QuickForm::addGroupRule() -- Adds a validation rule for the given group

Synopsis

Описание

Adds a validation rule for the given group of elements

Only groups with a name can be assigned a validation rule. Use addGroupRule() when you need to validate elements inside the group. Also use addRule() if you need to validate the group as a whole.

Параметр

string $group

Form group name

mixed $arg1

Array for multiple elements or error message string for one element. If this is the array, its structure is the following:

array (
    'element name or index' => array(
        array(rule data),
        ...
        array(rule data)
    ),
    ...
    'element name or index' => array(
        array(rule data),
        ...
        array(rule data)
    )
)
rule data here matches the parameters' order and meaning for addRule() method.

Замечание: If this parameter is an array, all the subsequent parameters are ignored. You should pass all the modifiers for the rules being added within this array (see the example below).

string $type

(optional) Rule type. Use getRegisteredRules() to get types. You can also pass a classname for a descendant of HTML_QuickForm_Rule or an instance of such class.

string $format

(optional) Required for extra rule data

integer $howmany

(optional) How many valid elements should be in the group

string $validation

(optional)Where to perform validation: "server", "client"

boolean $reset

Client-side: whether to reset the element's value to its original state if validation failed.

Throws

Заметка

since 2.5

Эта функция не должна вызываться статически.

Пример

    Поддержать сайт на родительском проекте КГБ