Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Container
  • ControlGroup
  • Form
  • Helpers
  • Rule
  • Rules
  • Validator

Interfaces

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

Class Container

Container for form controls.

Nette\Object
Extended by Nette\ComponentModel\Component implements Nette\ComponentModel\IComponent
Extended by Nette\ComponentModel\Container implements Nette\ComponentModel\IContainer
Extended by Nette\Forms\Container implements ArrayAccess

Direct known subclasses

Nette\Forms\Form

Indirect known subclasses

Nette\Application\UI\Form
Namespace: Nette\Forms
Located at Forms/Container.php
Methods summary
public Nette\Forms\Container
# setDefaults( array|Traversable $values, boolean $erase = FALSE )

Fill-in with default values.

Fill-in with default values.

Parameters

$values
used to fill the form
$erase
other default values?

Returns

Nette\Forms\Container
static
public Nette\Utils\ArrayHash|array
# getValues( boolean $asArray = FALSE )

Returns the values submitted by the form.

Returns the values submitted by the form.

Parameters

$asArray
values as an array?

Returns

Nette\Utils\ArrayHash|array
Nette\Utils\ArrayHash|array
public boolean
# isValid( )

Is form valid?

Is form valid?

Returns

boolean
bool
public
# validate( array $controls = NULL )

Performs the server side validation.

Performs the server side validation.

Parameters

$controls
public array
# getErrors( )

Returns all validation errors.

Returns all validation errors.

Returns

array
array
public Nette\Forms\Container
# setCurrentGroup( Nette\Forms\ControlGroup $group = NULL )

Returns

Nette\Forms\Container
static
public Nette\Forms\ControlGroup
# getCurrentGroup( )

Returns current group.

Returns current group.

Returns

Nette\Forms\ControlGroup
ControlGroup
public Nette\Forms\Container
# addComponent( Nette\ComponentModel\IComponent $component, string $name, string $insertBefore = NULL )

Adds the specified component to the IContainer.

Adds the specified component to the IContainer.

Parameters

$component
$name
$insertBefore

Returns

Nette\Forms\Container
static

Throws

Nette\InvalidStateException
Nette\InvalidStateException

Overrides

Nette\ComponentModel\Container::addComponent()
public ArrayIterator
# getControls( )

Iterates over all form controls.

Iterates over all form controls.

Returns

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

Returns form.

Returns form.

Parameters

$need
exception if form doesn't exist?

Returns

Nette\Forms\Form
Form
public Nette\Forms\Controls\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
name
$label
label
$cols
of the control (deprecated)
$maxLength
number of characters the user may enter

Returns

Nette\Forms\Controls\TextInput
Nette\Forms\Controls\TextInput
public Nette\Forms\Controls\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
name
$label
label
$cols
of the control (deprecated)
$maxLength
number of characters the user may enter

Returns

Nette\Forms\Controls\TextInput
Nette\Forms\Controls\TextInput
public Nette\Forms\Controls\TextArea
# addTextArea( string $name, string $label = NULL, integer $cols = NULL, integer $rows = NULL )

Adds multi-line text input control to the form.

Adds multi-line text input control to the form.

Parameters

$name
name
$label
label
$cols
of the control
$rows
of the control in text lines

Returns

Nette\Forms\Controls\TextArea
Nette\Forms\Controls\TextArea
public Nette\Forms\Controls\UploadControl
# addUpload( string $name, string $label = NULL, boolean $multiple = FALSE )

Adds control that allows the user to upload files.

Adds control that allows the user to upload files.

Parameters

$name
name
$label
label
$multiple
to upload multiple files

Returns

Nette\Forms\Controls\UploadControl
Nette\Forms\Controls\UploadControl
public Nette\Forms\Controls\UploadControl
# addMultiUpload( string $name, string $label = NULL )

Adds control that allows the user to upload multiple files.

Adds control that allows the user to upload multiple files.

Parameters

$name
name
$label
label

Returns

Nette\Forms\Controls\UploadControl
Nette\Forms\Controls\UploadControl
public Nette\Forms\Controls\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
name
$default
value

Returns

Nette\Forms\Controls\HiddenField
Nette\Forms\Controls\HiddenField
public Nette\Forms\Controls\Checkbox
# addCheckbox( string $name, string $caption = NULL )

Adds check box control to the form.

Adds check box control to the form.

Parameters

$name
name
$caption
caption

Returns

Nette\Forms\Controls\Checkbox
Nette\Forms\Controls\Checkbox
public Nette\Forms\Controls\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
name
$label
label
$items
from which to choose

Returns

Nette\Forms\Controls\RadioList
Nette\Forms\Controls\RadioList
public Nette\Forms\Controls\CheckboxList
# addCheckboxList( $name, $label = NULL, array $items = NULL )

Adds set of checkbox controls to the form.

Adds set of checkbox controls to the form.

Returns

Nette\Forms\Controls\CheckboxList
Nette\Forms\Controls\CheckboxList
public Nette\Forms\Controls\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
name
$label
label
$items
from which to choose
$size
of rows that should be visible

Returns

Nette\Forms\Controls\SelectBox
Nette\Forms\Controls\SelectBox
public Nette\Forms\Controls\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
name
$label
label
$items
from which to choose
$size
of rows that should be visible

Returns

Nette\Forms\Controls\MultiSelectBox
Nette\Forms\Controls\MultiSelectBox
public Nette\Forms\Controls\SubmitButton
# addSubmit( string $name, string $caption = NULL )

Adds button used to submit form.

Adds button used to submit form.

Parameters

$name
name
$caption
caption

Returns

Nette\Forms\Controls\SubmitButton
Nette\Forms\Controls\SubmitButton
public Nette\Forms\Controls\Button
# addButton( string $name, string $caption = NULL )

Adds push buttons with no default behavior.

Adds push buttons with no default behavior.

Parameters

$name
name
$caption
caption

Returns

Nette\Forms\Controls\Button
Nette\Forms\Controls\Button
public Nette\Forms\Controls\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
name
$src
of the image
$alt
text for the image

Returns

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

Adds naming container to the form.

Adds naming container to the form.

Parameters

$name
name

Returns

Nette\Forms\Container
self
public
# offsetSet( string $name, Nette\ComponentModel\IComponent $component )

Adds the component to the container.

Adds the component to the container.

Parameters

$name
name
$component

Implementation of

ArrayAccess::offsetSet()
public Nette\ComponentModel\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
name

Returns

Nette\ComponentModel\IComponent
Nette\ComponentModel\IComponent

Throws

Nette\InvalidArgumentException
Nette\InvalidArgumentException

Implementation of

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

Does component specified by name exists?

Does component specified by name exists?

Parameters

$name
name

Returns

boolean
bool

Implementation of

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

Removes component from the container.

Removes component from the container.

Parameters

$name
name

Implementation of

ArrayAccess::offsetUnset()
public
# __clone( )

Prevents cloning.

Prevents cloning.

Overrides

Nette\ComponentModel\Container::__clone()
Methods inherited from Nette\ComponentModel\Container
createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from Nette\ComponentModel\Component
__construct(), __sleep(), __wakeup(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), unmonitor(), validateParent()
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Methods inherited from Nette\ComponentModel\IComponent
setParent()
Constants inherited from Nette\ComponentModel\IComponent
NAME_SEPARATOR
Properties summary
public callable[] $onValidate

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

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

#
protected Nette\Forms\ControlGroup $currentGroup
#
Magic properties summary
public Nette\Utils\ArrayHash $values
public read-only ArrayIterator $controls
public read-only Nette\Forms\Form $form
Magic properties inherited from Nette\ComponentModel\Container
$components
Magic properties inherited from Nette\ComponentModel\Component
$name, $parent
Magic properties inherited from Nette\Object
$reflection
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0