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
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

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

Interfaces

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

Class Container

Container for form controls.

Nette\ComponentModel\Component implements Nette\ComponentModel\IComponent uses Nette\SmartObject
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( iterable $values, boolean $erase = false )

Fill-in with default values.

Fill-in with default values.

Parameters

$values
$erase

Returns

Nette\Forms\Container
static
public Nette\Forms\Container
# setValues( iterable $values, boolean $erase = false )

Fill-in with values.

Fill-in with values.

Parameters

$values
$erase

Returns

Nette\Forms\Container
static

Internal

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

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|null
# getCurrentGroup( )

Returns current group.

Returns current group.

Returns

Nette\Forms\ControlGroup|null
ControlGroup|null
public Nette\Forms\Container
# addComponent( Nette\ComponentModel\IComponent $component, string|integer $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 Iterator
# getControls( )

Iterates over all form controls.

Iterates over all form controls.

Returns

Iterator
\Iterator
public Nette\Forms\Form|null
# getForm( boolean $throw = true )

Returns form.

Returns form.

Parameters

$throw

Returns

Nette\Forms\Form|null
Form|null
public Nette\Forms\Controls\TextInput
# addText( string $name, string|object $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
$label
$cols
$maxLength

Returns

Nette\Forms\Controls\TextInput
Controls\TextInput
public Nette\Forms\Controls\TextInput
# addPassword( string $name, string|object $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
$label
$cols
$maxLength

Returns

Nette\Forms\Controls\TextInput
Controls\TextInput
public Nette\Forms\Controls\TextArea
# addTextArea( string $name, string|object $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
$label
$cols
$rows

Returns

Nette\Forms\Controls\TextArea
Controls\TextArea
public Nette\Forms\Controls\TextInput
# addEmail( string $name, string|object $label = null )

Adds input for email.

Adds input for email.

Parameters

$name
$label

Returns

Nette\Forms\Controls\TextInput
Controls\TextInput
public Nette\Forms\Controls\TextInput
# addInteger( string $name, string|object $label = null )

Adds input for integer.

Adds input for integer.

Parameters

$name
$label

Returns

Nette\Forms\Controls\TextInput
Controls\TextInput
public Nette\Forms\Controls\UploadControl
# addUpload( string $name, string|object $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
$label
$multiple

Returns

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

Adds control that allows the user to upload multiple files.

Adds control that allows the user to upload multiple files.

Parameters

$name
$label

Returns

Nette\Forms\Controls\UploadControl
Controls\UploadControl
public Nette\Forms\Controls\HiddenField
# addHidden( string $name, string $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
$default

Returns

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

Adds check box control to the form.

Adds check box control to the form.

Parameters

$name
$caption

Returns

Nette\Forms\Controls\Checkbox
Controls\Checkbox
public Nette\Forms\Controls\RadioList
# addRadioList( string $name, string|object $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
$label
$items

Returns

Nette\Forms\Controls\RadioList
Controls\RadioList
public Nette\Forms\Controls\CheckboxList
# addCheckboxList( string $name, string|object $label = null, array $items = null )

Adds set of checkbox controls to the form.

Adds set of checkbox controls to the form.

Parameters

$name
$label
$items

Returns

Nette\Forms\Controls\CheckboxList
Controls\CheckboxList
public Nette\Forms\Controls\SelectBox
# addSelect( string $name, string|object $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
$label
$items
$size

Returns

Nette\Forms\Controls\SelectBox
Controls\SelectBox
public Nette\Forms\Controls\MultiSelectBox
# addMultiSelect( string $name, string|object $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
$label
$items
$size

Returns

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

Adds button used to submit form.

Adds button used to submit form.

Parameters

$name
$caption

Returns

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

Adds push buttons with no default behavior.

Adds push buttons with no default behavior.

Parameters

$name
$caption

Returns

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

Returns

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

Adds naming container to the form.

Adds naming container to the form.

Parameters

$name

Returns

Nette\Forms\Container
self
public mixed
# __call( $name, $args )

Returns

mixed
mixed

Throws

MemberAccessException
MemberAccessException

Overrides

Nette\ComponentModel\Component::__call()
public static mixed
# extensionMethod( $name, $callback = null )

Deprecated

use Nette\Utils\ObjectMixin::setExtensionMethod()

Returns

mixed
mixed

Overrides

Nette\ComponentModel\Component::extensionMethod()
public
# offsetSet( string|integer $name, Nette\ComponentModel\IComponent $component )

Adds the component to the container.

Adds the component to the container.

Parameters

$name
$component

Implementation of

ArrayAccess::offsetSet()
public Nette\ComponentModel\IComponent
# offsetGet( string|integer $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

Returns

Nette\ComponentModel\IComponent
Nette\ComponentModel\IComponent

Throws

Nette\InvalidArgumentException
Nette\InvalidArgumentException

Implementation of

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

Does component specified by name exists?

Does component specified by name exists?

Parameters

$name

Returns

boolean
bool

Implementation of

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

Removes component from the container.

Removes component from the container.

Parameters

$name

Implementation of

ArrayAccess::offsetUnset()
public
# __clone( )

Prevents cloning.

Prevents cloning.

Overrides

Nette\ComponentModel\Container::__clone()
Methods inherited from Nette\ComponentModel\Container
_isCloning(), createComponent(), getComponent(), getComponents(), removeComponent(), validateChildComponent()
Methods inherited from Nette\ComponentModel\Component
__construct(), __sleep(), __wakeup(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent()
Methods used from Nette\SmartObject
__callStatic(), __get(), __isset(), __set(), __unset(), getReflection()
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|null $currentGroup
#
Magic properties summary
public Nette\Utils\ArrayHash $values
public read-only Iterator $controls
public read-only Nette\Forms\Form|null $form
Magic properties inherited from Nette\ComponentModel\Container
$components
Magic properties inherited from Nette\ComponentModel\Component
$name, $parent
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0