PHP Class Nette\Forms\Rules

Author: David Grudl
Inheritance: extends Nette\Object, implements IteratorAggregate
Afficher le fichier Open project: nette/forms Class Usage Examples

Méthodes publiques

Свойство Type Description
$defaultMessages

Méthodes publiques

Méthode Description
__construct ( Nette\Forms\IControl $control )
addCondition ( $validator, $arg = NULL ) : self Adds a validation condition and returns new branch.
addConditionOn ( Nette\Forms\IControl $control, $validator, $arg = NULL ) : self Adds a validation condition on specified control a returns new branch.
addFilter ( $filter ) : self Adds a filter callback.
addRule ( $validator, $message = NULL, $arg = NULL ) : self Adds a validation rule for the current control.
check ( )
elseCondition ( ) : self Adds a else statement.
endCondition ( ) : Rules Ends current validation condition.
getIterator ( ) : ArrayIterator Iterates over complete ruleset.
getToggleStates ( $toggles = [], $success = TRUE ) : array
getToggles ( $actual = FALSE ) : array
isOptional ( )
isRequired ( ) : boolean Is control mandatory?
setRequired ( $value = TRUE ) : self Makes control mandatory.
toggle ( $id, $hide = TRUE ) : self Toggles HTML element visibility.
validate ( $emptyOptional = FALSE ) : boolean Validates against ruleset.
validateRule ( Rule $rule ) : boolean Validates single rule.

Private Methods

Méthode Description
adjustOperation ( $rule ) : void Process 'operation' string.
getCallback ( $rule )

Method Details

__construct() public méthode

public __construct ( Nette\Forms\IControl $control )
$control Nette\Forms\IControl

addCondition() public méthode

Adds a validation condition and returns new branch.
public addCondition ( $validator, $arg = NULL ) : self
Résultat self new branch

addConditionOn() public méthode

Adds a validation condition on specified control a returns new branch.
public addConditionOn ( Nette\Forms\IControl $control, $validator, $arg = NULL ) : self
$control Nette\Forms\IControl
Résultat self new branch

addFilter() public méthode

Adds a filter callback.
public addFilter ( $filter ) : self
Résultat self

addRule() public méthode

Adds a validation rule for the current control.
public addRule ( $validator, $message = NULL, $arg = NULL ) : self
Résultat self

check() public méthode

public check ( )

elseCondition() public méthode

Adds a else statement.
public elseCondition ( ) : self
Résultat self else branch

endCondition() public méthode

Ends current validation condition.
public endCondition ( ) : Rules
Résultat Rules parent branch

getIterator() public méthode

Iterates over complete ruleset.
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

getToggleStates() public méthode

public getToggleStates ( $toggles = [], $success = TRUE ) : array
Résultat array

getToggles() public méthode

public getToggles ( $actual = FALSE ) : array
Résultat array

isOptional() public méthode

public isOptional ( )

isRequired() public méthode

Is control mandatory?
public isRequired ( ) : boolean
Résultat boolean

setRequired() public méthode

Makes control mandatory.
public setRequired ( $value = TRUE ) : self
Résultat self

toggle() public méthode

Toggles HTML element visibility.
public toggle ( $id, $hide = TRUE ) : self
Résultat self

validate() public méthode

Validates against ruleset.
public validate ( $emptyOptional = FALSE ) : boolean
Résultat boolean

validateRule() public static méthode

Validates single rule.
public static validateRule ( Rule $rule ) : boolean
$rule Rule
Résultat boolean

Property Details

$defaultMessages public_oe static_oe property

Deprecation:
public static $defaultMessages