Rules
final 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 36
__construct(Control $control)
No description
at line 45
Rules
setRequired(string|Stringable|bool $value = true)
Makes control mandatory.
at line 60
bool
isRequired()
Is control mandatory?
at line 69
Rules
addRule(callable|string $validator, string|Stringable|null $errorMessage = null, mixed $arg = null)
Adds a validation rule for the current control.
at line 98
Rules
removeRule(callable|string $validator)
Removes a validation rule for the current control.
at line 117
Rules
addCondition($validator, $arg = null)
Adds a validation condition and returns new branch.
at line 133
Rules
addConditionOn(Control $control, $validator, $arg = null)
Adds a validation condition on specified control a returns new branch.
at line 151
Rules
elseCondition()
Adds a else statement.
at line 170
Rules
endCondition()
Ends current validation condition.
at line 179
Rules
addFilter(callable $filter)
Adds a filter callback.
at line 194
Rules
toggle(string $id, bool $hide = true)
Toggles HTML element visibility.
at line 201
array
getToggles(bool $actual = false)
No description
at line 208
array
getToggleStates(array $toggles = [], bool $success = true, bool|null $emptyOptional = null)
internal |
No description
at line 234
bool
validate(bool|null $emptyOptional = null)
Validates against ruleset.
at line 263
void
reset()
Clear all validation rules.
at line 272
static bool
validateRule(Rule $rule)
Validates single rule.
at line 288
Iterator
getIterator()
Iterates over complete ruleset.