Rules
class Rules implements IteratorAggregate
List of validation & condition rules.
Constants
private NegRules |
|
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 44
__construct(Control $control)
No description
at line 55
Rules
setRequired(string|bool $value = true)
Makes control mandatory.
at line 70
bool
isRequired()
Is control mandatory?
at line 82
Rules
addRule(callable|string $validator, string|object $errorMessage = null, $arg = null)
Adds a validation rule for the current control.
at line 109
Rules
removeRule(callable|string $validator)
Removes a validation rule for the current control.
at line 129
Rules
addCondition($validator, $arg = null)
Adds a validation condition and returns new branch.
at line 146
Rules
addConditionOn(Control $control, $validator, $arg = null)
Adds a validation condition on specified control a returns new branch.
at line 165
Rules
elseCondition()
Adds a else statement.
at line 185
Rules
endCondition()
Ends current validation condition.
at line 195
Rules
addFilter(callable $filter)
Adds a filter callback.
at line 211
Rules
toggle(string $id, bool $hide = true)
Toggles HTML element visibility.
at line 218
array
getToggles(bool $actual = false)
No description
at line 225
array
getToggleStates(array $toggles = [], bool $success = true, bool|null $emptyOptional = null)
internal |
No description
at line 251
bool
validate(bool|null $emptyOptional = null)
Validates against ruleset.
at line 280
void
reset()
Clear all validation rules.
at line 289
static bool
validateRule(Rule $rule)
Validates single rule.
at line 305
Iterator
getIterator()
Iterates over complete ruleset.