Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • Button
  • Checkbox
  • ConventionalRenderer
  • FileUpload
  • Form
  • FormContainer
  • FormControl
  • FormGroup
  • HiddenField
  • ImageButton
  • InstantClientScript
  • MultiSelectBox
  • RadioList
  • Rule
  • Rules
  • SelectBox
  • SubmitButton
  • TextArea
  • TextBase
  • TextInput

Interfaces

  • IFormControl
  • IFormRenderer
  • INamingContainer
  • ISubmitterControl
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class Rules

List of validation & condition rules.

Nette\Object
Extended by Nette\Forms\Rules implements IteratorAggregate
Final
Namespace: Nette\Forms
Author: David Grudl
Located at Forms/Rules.php
Methods summary
public
# __construct( Nette\Forms\IFormControl $control )
public Nette\Forms\Rules
# addRule( mixed $operation, string $message = NULL, mixed $arg = NULL )

Adds a validation rule for the current control.

Adds a validation rule for the current control.

Parameters

$operation
mixed
rule type
$message
string
message to display for invalid data
$arg
mixed
optional rule arguments

Returns

Nette\Forms\Rules
provides a fluent interface
public Nette\Forms\Rules
# addCondition( mixed $operation, mixed $arg = NULL )

Adds a validation condition a returns new branch.

Adds a validation condition a returns new branch.

Parameters

$operation
mixed
condition type
$arg
mixed
optional condition arguments

Returns

Nette\Forms\Rules
new branch
public Nette\Forms\Rules
# addConditionOn( Nette\Forms\IFormControl $control, mixed $operation, mixed $arg = NULL )

Adds a validation condition on specified control a returns new branch.

Adds a validation condition on specified control a returns new branch.

Parameters

$control
Nette\Forms\IFormControl
form control
$operation
mixed
condition type
$arg
mixed
optional condition arguments

Returns

Nette\Forms\Rules
new branch
public Nette\Forms\Rules
# elseCondition( )

Adds a else statement.

Adds a else statement.

Returns

Nette\Forms\Rules
else branch
public Nette\Forms\Rules
# endCondition( )

Ends current validation condition.

Ends current validation condition.

Returns

Nette\Forms\Rules
parent branch
public Nette\Forms\Rules
# toggle( string $id, boolean $hide = TRUE )

Toggles HTML elememnt visibility.

Toggles HTML elememnt visibility.

Parameters

$id
string
element id
$hide
boolean
hide element?

Returns

Nette\Forms\Rules
provides a fluent interface
public boolean
# validate( boolean $onlyCheck = FALSE )

Validates against ruleset.

Validates against ruleset.

Parameters

$onlyCheck
boolean
stop before first error?

Returns

boolean
is valid?
final public ArrayIterator
# getIterator( )

Iterates over ruleset.

Iterates over ruleset.

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator
final public array
# getToggles( )

Returns

array
public static
# formatMessage( $rule, $withValue )
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
public static array $defaultMessages array( )
#
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0