Factory method to construct a validator based on options that are used most of the times
public createRule ( string | callable $name, string | array $options = null, string $messageTemplate = null, string $label = null ) : Sirius\Validation\Rule\AbstractValidator | ||
$name | string | callable | name of a validator class or a callable object/function |
$options | string | array | validator options (an array, JSON string or QUERY string) |
$messageTemplate | string | error message template |
$label | string | label of the form input field or model attribute |
return | Sirius\Validation\Rule\AbstractValidator |