Packages

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

Classes

  • NButton
  • NCheckbox
  • NConventionalRenderer
  • NFileUpload
  • NForm
  • NFormContainer
  • NFormGroup
  • NHiddenField
  • NImageButton
  • NInstantClientScript
  • NMultiSelectBox
  • NRadioList
  • NRule
  • NRules
  • NSelectBox
  • NSubmitButton
  • NTextArea
  • NTextBase
  • NTextInput

Interfaces

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

Class NRules

List of validation & condition rules.

NObject
Extended by NRules implements IteratorAggregate
Final
Package: Nette\Forms
Author: David Grudl
Located at Forms/Rules.php
Methods summary
public
# __construct( IFormControl $control )
public NRules
# 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

NRules
provides a fluent interface
public NRules
# 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

NRules
new branch
public NRules
# addConditionOn( 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
IFormControl
form control
$operation
mixed
condition type
$arg
mixed
optional condition arguments

Returns

NRules
new branch
public NRules
# elseCondition( )

Adds a else statement.

Adds a else statement.

Returns

NRules
else branch
public NRules
# endCondition( )

Ends current validation condition.

Ends current validation condition.

Returns

NRules
parent branch
public NRules
# toggle( string $id, boolean $hide = TRUE )

Toggles HTML elememnt visibility.

Toggles HTML elememnt visibility.

Parameters

$id
string
element id
$hide
boolean
hide element?

Returns

NRules
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 NObject
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
public static array $defaultMessages array( )
#
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0