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 FormContainer

Container for form controls.

Nette\Object
Extended by Nette\Component implements Nette\IComponent
Extended by Nette\ComponentContainer implements Nette\IComponentContainer
Extended by Nette\Forms\FormContainer implements ArrayAccess, Nette\Forms\INamingContainer

Direct known subclasses

Nette\Forms\Form

Indirect known subclasses

Nette\Application\AppForm
Namespace: Nette\Forms
Author: David Grudl
Located at Forms/FormContainer.php
Methods summary
public Nette\Forms\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

Nette\Forms\FormContainer
provides a fluent interface
public Nette\Forms\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

Nette\Forms\FormContainer
provides a fluent interface
public array
# getValues( )

Returns the values submitted by the form.

Returns the values submitted by the form.

Returns

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 Nette\Forms\FormContainer
# setCurrentGroup( Nette\Forms\FormGroup $group = NULL )

Parameters

$group
Nette\Forms\FormGroup

Returns

Nette\Forms\FormContainer
provides a fluent interface
public
# addComponent( Nette\IComponent $component, string $name, string $insertBefore = NULL )

Adds the specified component to the IComponentContainer.

Adds the specified component to the IComponentContainer.

Parameters

$component
IComponent
$name
string
$insertBefore
string

Throws

InvalidStateException

Implementation of

Nette\IComponentContainer::addComponent
public ArrayIterator
# getControls( )

Iterates over all form controls.

Iterates over all form controls.

Returns

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

Returns form.

Returns form.

Parameters

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

Returns

Nette\Forms\Form
public Nette\Forms\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

Nette\Forms\TextInput
public Nette\Forms\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

Nette\Forms\TextInput
public Nette\Forms\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

Nette\Forms\TextArea
public Nette\Forms\FileUpload
# addFile( 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

Nette\Forms\FileUpload
public Nette\Forms\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

Nette\Forms\HiddenField
public Nette\Forms\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

Nette\Forms\Checkbox
public Nette\Forms\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

Nette\Forms\RadioList
public Nette\Forms\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

Nette\Forms\SelectBox
public Nette\Forms\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

Nette\Forms\MultiSelectBox
public Nette\Forms\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

Nette\Forms\SubmitButton
public Nette\Forms\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

Nette\Forms\Button
public Nette\Forms\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

Nette\Forms\ImageButton
public Nette\Forms\FormContainer
# addContainer( string $name )

Adds naming container to the form.

Adds naming container to the form.

Parameters

$name
string
name

Returns

Nette\Forms\FormContainer
final public
# offsetSet( string $name, Nette\IComponent $component )

Adds the component to the container.

Adds the component to the container.

Parameters

$name
string
component name
$component
Nette\IComponent

Implementation of

ArrayAccess::offsetSet
final public Nette\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

Nette\IComponent

Throws

InvalidArgumentException

Implementation of

ArrayAccess::offsetGet
final 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
final public
# offsetUnset( string $name )

Removes component from the container.

Removes component from the container.

Parameters

$name
string
component name

Implementation of

ArrayAccess::offsetUnset
final public
# __clone( )

Prevents cloning.

Prevents cloning.

Methods inherited from Nette\ComponentContainer
createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from Nette\Component
__construct(), __wakeup(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent()
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\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 Nette\Forms\FormGroup $currentGroup
#
protected boolean $valid
#
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0