Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

  • Container
  • ControlGroup
  • Form
  • Rule
  • Rules

Interfaces

  • IControl
  • IFormRenderer
  • ISubmitterControl
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Rules

List of validation & condition rules.

Nette\Object
Extended by Nette\Forms\Rules implements IteratorAggregate
Namespace: Nette\Forms
Author: David Grudl
Located at Forms/Rules.php
Methods summary
public
# __construct( Nette\Forms\IControl $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
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\IControl $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\IControl
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
public boolean
# validate( boolean $onlyCheck = FALSE )

Validates against ruleset.

Validates against ruleset.

Parameters

$onlyCheck
boolean
stop before first error?

Returns

boolean
is valid?
public ArrayIterator
# getIterator( )

Iterates over ruleset.

Iterates over ruleset.

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator()
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( Form::PROTECTION => 'Your session has expired. Please return to the home page and try again.', Form::EQUAL => 'Please enter %s.', Form::FILLED => 'Please complete mandatory field.', Form::MIN_LENGTH => 'Please enter a value of at least %d characters.', Form::MAX_LENGTH => 'Please enter a value no longer than %d characters.', Form::LENGTH => 'Please enter a value between %d and %d characters long.', Form::EMAIL => 'Please enter a valid email address.', Form::URL => 'Please enter a valid URL.', Form::INTEGER => 'Please enter a numeric value.', Form::FLOAT => 'Please enter a numeric value.', Form::RANGE => 'Please enter a value between %d and %d.', Form::MAX_FILE_SIZE => 'The size of the uploaded file can be up to %d bytes.', Form::IMAGE => 'The uploaded file must be image in format JPEG, GIF or PNG.', Form::MIME_TYPE => 'The uploaded file is not in the expected format.', )
#
Magic properties inherited from Nette\Object
$reflection
Nette 2.0 API documentation generated by ApiGen 2.8.0