Contains rule methods applied to an element. The FormItBuilder object is then assigned rules using the addRules method.

package FormItBuilder

 Methods

FormRule

__construct(string $type, mixed $element, mixed $value, string $validationMessage) 

Form Rule constructor

Parameters

$type

string

Recommend using FormRule constant to determine rule types

$element

mixed

A single form element or an array of form elements

$value

mixed

Some elements may set a value (e.g. a maximum width of 5 would use the value 5).

$validationMessage

string

A validation message to be used if the rule fails validation.

Returns a reference to the element object .

getElement() : object

Returns

object

Returns the rule type (should match a FormRuleType constant).

getType() : string

Returns

string

Returns the rule validation message.

getValidationMessage() : string

Returns

string

Returns rule value.

getValue() : string

Returns

string

Sets the validation message to be used if the rule fails validation.

setValidationMessage(string $value) 

Parameters

$value

string