Rules
class Rules implements IteratorAggregate
List of validation & condition rules.
Constants
private NEG_RULES |
|
Methods
Makes control mandatory.
Is control mandatory?
Adds a validation rule for the current control.
Removes a validation rule for the current control.
Adds a validation condition and returns new branch.
Adds a validation condition on specified control a returns new branch.
Adds a else statement.
Ends current validation condition.
No description
No description
Validates against ruleset.
Clear all validation rules.
Iterates over complete ruleset.
Details
at line 43
__construct(IControl $control)
No description
at line 54
Rules
setRequired(string|bool $value = true)
Makes control mandatory.
at line 68
bool
isRequired()
Is control mandatory?
at line 80
Rules
addRule(callable|string $validator, string|object $errorMessage = null, $arg = null)
Adds a validation rule for the current control.
at line 105
Rules
removeRule(callable|string $validator)
Removes a validation rule for the current control.
at line 124
Rules
addCondition($validator, $arg = null)
Adds a validation condition and returns new branch.
at line 140
Rules
addConditionOn(IControl $control, $validator, $arg = null)
Adds a validation condition on specified control a returns new branch.
at line 159
Rules
elseCondition()
Adds a else statement.
at line 178
Rules
endCondition()
Ends current validation condition.
at line 188
Rules
addFilter(callable $filter)
Adds a filter callback.
at line 204
Rules
toggle(string $id, bool $hide = true)
Toggles HTML element visibility.
at line 211
array
getToggles(bool $actual = false)
No description
at line 218
array
getToggleStates(array $toggles = [], bool $success = true, bool $emptyOptional = null)
internal |
No description
at line 243
bool
validate(bool $emptyOptional = null)
Validates against ruleset.
at line 271
void
reset()
Clear all validation rules.
at line 280
static bool
validateRule(Rule $rule)
Validates single rule.
at line 294
Iterator
getIterator()
Iterates over complete ruleset.