Packages

  • 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

Interfaces

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class FormContainer

Container for form controls.

Object
Extended by Component implements IComponent
Extended by ComponentContainer implements IComponentContainer
Extended by FormContainer implements ArrayAccess

Direct known subclasses

Form

Indirect known subclasses

AppForm
Package: Nette\Forms
Author: David Grudl
Located at Forms/Container.php
Methods summary
public FormContainer
# setDefaults( array|Traversable $values, boolean $erase = FALSE )

Fill-in with default values.

Fill-in with default values.

Parameters

$values
array|Traversable
values used to fill the form
$erase
boolean
erase other default values?

Returns

FormContainer
public FormContainer
# setValues( array|Traversable $values, boolean $erase = FALSE )

Fill-in with values.

Fill-in with values.

Parameters

$values
array|Traversable
values used to fill the form
$erase
boolean
erase other controls?

Returns

FormContainer
public ArrayHash|array
# getValues( boolean $asArray = FALSE )

Returns the values submitted by the form.

Returns the values submitted by the form.

Parameters

$asArray
boolean
return values as an array?

Returns

ArrayHash|array
public boolean
# isValid( )

Is form valid?

Is form valid?

Returns

boolean
public
# validate( )

Performs the server side validation.

Performs the server side validation.

public FormContainer
# setCurrentGroup( FormGroup $group = NULL )

Returns

FormContainer
public FormGroup
# getCurrentGroup( )

Returns current group.

Returns current group.

Returns

FormGroup
public FormContainer
# addComponent( IComponent $component, string $name, string $insertBefore = NULL )

Adds the specified component to the IContainer.

Adds the specified component to the IContainer.

Parameters

$component
IComponent
$name
string
$insertBefore
string

Returns

FormContainer

Throws

InvalidStateException

Overrides

ComponentContainer::addComponent()
public ArrayIterator
# getControls( )

Iterates over all form controls.

Iterates over all form controls.

Returns

ArrayIterator
public Form
# getForm( boolean $need = TRUE )

Returns form.

Returns form.

Parameters

$need
boolean
throw exception if form doesn't exist?

Returns

Form
public TextInput
# addText( string $name, string $label = NULL, integer $cols = NULL, integer $maxLength = NULL )

Adds single-line text input control to the form.

Adds single-line text input control to the form.

Parameters

$name
string
control name
$label
string
label
$cols
integer
width of the control
$maxLength
integer
maximum number of characters the user may enter

Returns

TextInput
public TextInput
# addPassword( string $name, string $label = NULL, integer $cols = NULL, integer $maxLength = NULL )

Adds single-line text input control used for sensitive input such as passwords.

Adds single-line text input control used for sensitive input such as passwords.

Parameters

$name
string
control name
$label
string
label
$cols
integer
width of the control
$maxLength
integer
maximum number of characters the user may enter

Returns

TextInput
public TextArea
# addTextArea( string $name, string $label = NULL, integer $cols = 40, integer $rows = 10 )

Adds multi-line text input control to the form.

Adds multi-line text input control to the form.

Parameters

$name
string
control name
$label
string
label
$cols
integer
width of the control
$rows
integer
height of the control in text lines

Returns

TextArea
public UploadControl
# addUpload( string $name, string $label = NULL )

Adds control that allows the user to upload files.

Adds control that allows the user to upload files.

Parameters

$name
string
control name
$label
string
label

Returns

UploadControl
public HiddenField
# addHidden( string $name, mixed $default = NULL )

Adds hidden form control used to store a non-displayed value.

Adds hidden form control used to store a non-displayed value.

Parameters

$name
string
control name
$default
mixed
default value

Returns

HiddenField
public Checkbox
# addCheckbox( string $name, string $caption = NULL )

Adds check box control to the form.

Adds check box control to the form.

Parameters

$name
string
control name
$caption
string
caption

Returns

Checkbox
public RadioList
# addRadioList( string $name, string $label = NULL, array $items = NULL )

Adds set of radio button controls to the form.

Adds set of radio button controls to the form.

Parameters

$name
string
control name
$label
string
label
$items
array
options from which to choose

Returns

RadioList
public SelectBox
# addSelect( string $name, string $label = NULL, array $items = NULL, integer $size = NULL )

Adds select box control that allows single item selection.

Adds select box control that allows single item selection.

Parameters

$name
string
control name
$label
string
label
$items
array
items from which to choose
$size
integer
number of rows that should be visible

Returns

SelectBox
public MultiSelectBox
# addMultiSelect( string $name, string $label = NULL, array $items = NULL, integer $size = NULL )

Adds select box control that allows multiple item selection.

Adds select box control that allows multiple item selection.

Parameters

$name
string
control name
$label
string
label
$items
array
options from which to choose
$size
integer
number of rows that should be visible

Returns

MultiSelectBox
public SubmitButton
# addSubmit( string $name, string $caption = NULL )

Adds button used to submit form.

Adds button used to submit form.

Parameters

$name
string
control name
$caption
string
caption

Returns

SubmitButton
public Button
# addButton( string $name, string $caption )

Adds push buttons with no default behavior.

Adds push buttons with no default behavior.

Parameters

$name
string
control name
$caption
string
caption

Returns

Button
public ImageButton
# addImage( string $name, string $src = NULL, string $alt = NULL )

Adds graphical button used to submit form.

Adds graphical button used to submit form.

Parameters

$name
string
control name
$src
string
URI of the image
$alt
string
alternate text for the image

Returns

ImageButton
public FormContainer
# addContainer( string $name )

Adds naming container to the form.

Adds naming container to the form.

Parameters

$name
string
name

Returns

FormContainer
public
# offsetSet( string $name, IComponent $component )

Adds the component to the container.

Adds the component to the container.

Parameters

$name
string
component name
$component
IComponent

Implementation of

ArrayAccess::offsetSet()
public IComponent
# offsetGet( string $name )

Returns component specified by name. Throws exception if component doesn't exist.

Returns component specified by name. Throws exception if component doesn't exist.

Parameters

$name
string
component name

Returns

IComponent

Throws

InvalidArgumentException

Implementation of

ArrayAccess::offsetGet()
public boolean
# offsetExists( string $name )

Does component specified by name exists?

Does component specified by name exists?

Parameters

$name
string
component name

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public
# offsetUnset( string $name )

Removes component from the container.

Removes component from the container.

Parameters

$name
string
component name

Implementation of

ArrayAccess::offsetUnset()
public
# __clone( )

Prevents cloning.

Prevents cloning.

Overrides

ComponentContainer::__clone()
public
# addFile( $name, $label = NULL )

Deprecated

Methods inherited from ComponentContainer
createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from Component
__construct(), __sleep(), __wakeup(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), unmonitor(), validateParent()
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Methods inherited from IComponent
setParent()
Constants inherited from IComponent
NAME_SEPARATOR
Properties summary
public array $onValidate
#

of function(Form $sender); Occurs when the form is validated

of function(Form $sender); Occurs when the form is validated

protected FormGroup $currentGroup
#
protected boolean $valid
#
Magic properties summary
public ArrayHash $values
#
public FormGroup $currentGroup
#
public read-only boolean $valid
#
public read-only ArrayIterator $controls
#
public read-only Form $form
#
public write-only $defaults
#
Magic properties inherited from ComponentContainer
$components
Magic properties inherited from Component
$name, $parent
Magic properties inherited from Object
$reflection
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0