Rules
final 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 40
__construct(Control $control)
No description
at line 49
Rules
setRequired(string|Stringable|bool $value = true)
Makes control mandatory.
at line 64
bool
isRequired()
Is control mandatory?
at line 73
Rules
addRule(callable|string $validator, string|Stringable|null $errorMessage = null, mixed $arg = null)
Adds a validation rule for the current control.
at line 101
Rules
removeRule(callable|string $validator)
Removes a validation rule for the current control.
at line 120
Rules
addCondition($validator, $arg = null)
Adds a validation condition and returns new branch.
at line 136
Rules
addConditionOn(Control $control, $validator, $arg = null)
Adds a validation condition on specified control a returns new branch.
at line 154
Rules
elseCondition()
Adds a else statement.
at line 173
Rules
endCondition()
Ends current validation condition.
at line 182
Rules
addFilter(callable $filter)
Adds a filter callback.
at line 197
Rules
toggle(string $id, bool $hide = true)
Toggles HTML element visibility.
at line 204
array
getToggles(bool $actual = false)
No description
at line 211
array
getToggleStates(array $toggles = [], bool $success = true, bool|null $emptyOptional = null)
internal |
No description
at line 237
bool
validate(bool|null $emptyOptional = null)
Validates against ruleset.
at line 266
void
reset()
Clear all validation rules.
at line 275
static bool
validateRule(Rule $rule)
Validates single rule.
at line 291
Iterator
getIterator()
Iterates over complete ruleset.
Traits
Strict class for better experience.