interface RuleInterface

Rule interface.

Methods

bool
validateWhenEmpty()

Returns true if the rule should be executed when the input is empty and false if not.

bool
validate(mixed $value, array $input)

Returns true if the rule succeeds and false if not.

string
getErrorMessage(string $field)

Returns an error message.

Details

at line 22
bool validateWhenEmpty()

Returns true if the rule should be executed when the input is empty and false if not.

Return Value

bool

at line 31
bool validate(mixed $value, array $input)

Returns true if the rule succeeds and false if not.

Parameters

mixed $value Value to validate
array $input Input

Return Value

bool

at line 39
string getErrorMessage(string $field)

Returns an error message.

Parameters

string $field Field name

Return Value

string