PHP Class Nette\Forms\Container

Inheritance: extends Nette\ComponentModel\Container, implements ArrayAccess
Exibir arquivo Open project: nette/forms Class Usage Examples

Public Properties

Property Type Description
$onValidate function (Container $sender); Occurs when the form is validated

Protected Properties

Property Type Description
$currentGroup ControlGroup

Public Methods

Method Description
__call ( $name, $args ) ******************* extension methods ****************d*g*
__clone ( ) Prevents cloning.
addButton ( $name, $caption = NULL ) : Nette\Forms\Controls\Button Adds push buttons with no default behavior.
addCheckbox ( $name, $caption = NULL ) : Checkbox Adds check box control to the form.
addCheckboxList ( $name, $label = NULL, array $items = NULL ) : CheckboxList Adds set of checkbox controls to the form.
addComponent ( Nette\ComponentModel\IComponent $component, $name, $insertBefore = NULL ) : self Adds the specified component to the IContainer.
addContainer ( $name ) : Container Adds naming container to the form.
addEmail ( $name, $label = NULL ) : TextInput Adds input for email.
addHidden ( $name, $default = NULL ) : HiddenField Adds hidden form control used to store a non-displayed value.
addImage ( $name, $src = NULL, $alt = NULL ) : Nette\Forms\Controls\ImageButton Adds graphical button used to submit form.
addInteger ( $name, $label = NULL ) : TextInput Adds input for integer.
addMultiSelect ( $name, $label = NULL, array $items = NULL, $size = NULL ) : MultiSelectBox Adds select box control that allows multiple item selection.
addMultiUpload ( $name, $label = NULL ) : UploadControl Adds control that allows the user to upload multiple files.
addPassword ( $name, $label = NULL, $cols = NULL, $maxLength = NULL ) : TextInput Adds single-line text input control used for sensitive input such as passwords.
addRadioList ( $name, $label = NULL, array $items = NULL ) : RadioList Adds set of radio button controls to the form.
addSelect ( $name, $label = NULL, array $items = NULL, $size = NULL ) : SelectBox Adds select box control that allows single item selection.
addSubmit ( $name, $caption = NULL ) : Nette\Forms\Controls\SubmitButton Adds button used to submit form.
addText ( $name, $label = NULL, $cols = NULL, $maxLength = NULL ) : TextInput Adds single-line text input control to the form.
addTextArea ( $name, $label = NULL, $cols = NULL, $rows = NULL ) : TextArea Adds multi-line text input control to the form.
addUpload ( $name, $label = NULL, $multiple = FALSE ) : UploadControl Adds control that allows the user to upload files.
extensionMethod ( $name, $callback = NULL )
getControls ( ) : ArrayIterator Iterates over all form controls.
getCurrentGroup ( ) : ControlGroup Returns current group.
getErrors ( ) : array Returns all validation errors.
getForm ( $need = TRUE ) : Form Returns form.
getValues ( $asArray = FALSE ) : Nette\Utils\ArrayHash | array Returns the values submitted by the form.
isValid ( ) : boolean Is form valid?
offsetExists ( $name ) : boolean Does component specified by name exists?
offsetGet ( $name ) : Nette\ComponentModel\IComponent Returns component specified by name. Throws exception if component doesn't exist.
offsetSet ( $name, $component ) : void Adds the component to the container.
offsetUnset ( $name ) : void Removes component from the container.
setCurrentGroup ( ControlGroup $group = NULL ) : self
setDefaults ( $values, $erase = FALSE ) : self Fill-in with default values.
setValues ( $values, $erase = FALSE ) : self Fill-in with values.
validate ( array $controls = NULL ) : void Performs the server side validation.

Method Details

__call() public method

******************* extension methods ****************d*g*
public __call ( $name, $args )

__clone() public method

Prevents cloning.
public __clone ( )

addButton() public method

Adds push buttons with no default behavior.
public addButton ( $name, $caption = NULL ) : Nette\Forms\Controls\Button
return Nette\Forms\Controls\Button

addCheckbox() public method

Adds check box control to the form.
public addCheckbox ( $name, $caption = NULL ) : Checkbox
return Nette\Forms\Controls\Checkbox

addCheckboxList() public method

Adds set of checkbox controls to the form.
public addCheckboxList ( $name, $label = NULL, array $items = NULL ) : CheckboxList
$items array
return Nette\Forms\Controls\CheckboxList

addComponent() public method

Adds the specified component to the IContainer.
public addComponent ( Nette\ComponentModel\IComponent $component, $name, $insertBefore = NULL ) : self
$component Nette\ComponentModel\IComponent
return self

addContainer() public method

Adds naming container to the form.
public addContainer ( $name ) : Container
return Container

addEmail() public method

Adds input for email.
public addEmail ( $name, $label = NULL ) : TextInput
return Nette\Forms\Controls\TextInput

addHidden() public method

Adds hidden form control used to store a non-displayed value.
public addHidden ( $name, $default = NULL ) : HiddenField
return Nette\Forms\Controls\HiddenField

addImage() public method

Adds graphical button used to submit form.
public addImage ( $name, $src = NULL, $alt = NULL ) : Nette\Forms\Controls\ImageButton
return Nette\Forms\Controls\ImageButton

addInteger() public method

Adds input for integer.
public addInteger ( $name, $label = NULL ) : TextInput
return Nette\Forms\Controls\TextInput

addMultiSelect() public method

Adds select box control that allows multiple item selection.
public addMultiSelect ( $name, $label = NULL, array $items = NULL, $size = NULL ) : MultiSelectBox
$items array
return Nette\Forms\Controls\MultiSelectBox

addMultiUpload() public method

Adds control that allows the user to upload multiple files.
public addMultiUpload ( $name, $label = NULL ) : UploadControl
return Nette\Forms\Controls\UploadControl

addPassword() public method

Adds single-line text input control used for sensitive input such as passwords.
public addPassword ( $name, $label = NULL, $cols = NULL, $maxLength = NULL ) : TextInput
return Nette\Forms\Controls\TextInput

addRadioList() public method

Adds set of radio button controls to the form.
public addRadioList ( $name, $label = NULL, array $items = NULL ) : RadioList
$items array
return Nette\Forms\Controls\RadioList

addSelect() public method

Adds select box control that allows single item selection.
public addSelect ( $name, $label = NULL, array $items = NULL, $size = NULL ) : SelectBox
$items array
return Nette\Forms\Controls\SelectBox

addSubmit() public method

Adds button used to submit form.
public addSubmit ( $name, $caption = NULL ) : Nette\Forms\Controls\SubmitButton
return Nette\Forms\Controls\SubmitButton

addText() public method

Adds single-line text input control to the form.
public addText ( $name, $label = NULL, $cols = NULL, $maxLength = NULL ) : TextInput
return Nette\Forms\Controls\TextInput

addTextArea() public method

Adds multi-line text input control to the form.
public addTextArea ( $name, $label = NULL, $cols = NULL, $rows = NULL ) : TextArea
return Nette\Forms\Controls\TextArea

addUpload() public method

Adds control that allows the user to upload files.
public addUpload ( $name, $label = NULL, $multiple = FALSE ) : UploadControl
return Nette\Forms\Controls\UploadControl

extensionMethod() public static method

public static extensionMethod ( $name, $callback = NULL )

getControls() public method

Iterates over all form controls.

getCurrentGroup() public method

Returns current group.
public getCurrentGroup ( ) : ControlGroup
return ControlGroup

getErrors() public method

Returns all validation errors.
public getErrors ( ) : array
return array

getForm() public method

Returns form.
public getForm ( $need = TRUE ) : Form
return Form

getValues() public method

Returns the values submitted by the form.
public getValues ( $asArray = FALSE ) : Nette\Utils\ArrayHash | array
return Nette\Utils\ArrayHash | array

isValid() public method

Is form valid?
public isValid ( ) : boolean
return boolean

offsetExists() public method

Does component specified by name exists?
public offsetExists ( $name ) : boolean
return boolean

offsetGet() public method

Returns component specified by name. Throws exception if component doesn't exist.
public offsetGet ( $name ) : Nette\ComponentModel\IComponent
return Nette\ComponentModel\IComponent

offsetSet() public method

Adds the component to the container.
public offsetSet ( $name, $component ) : void
return void

offsetUnset() public method

Removes component from the container.
public offsetUnset ( $name ) : void
return void

setCurrentGroup() public method

public setCurrentGroup ( ControlGroup $group = NULL ) : self
$group ControlGroup
return self

setDefaults() public method

Fill-in with default values.
public setDefaults ( $values, $erase = FALSE ) : self
return self

setValues() public method

Fill-in with values.
public setValues ( $values, $erase = FALSE ) : self
return self

validate() public method

Performs the server side validation.
public validate ( array $controls = NULL ) : void
$controls array
return void

Property Details

$currentGroup protected_oe property

protected ControlGroup,Nette\Forms $currentGroup
return ControlGroup

$onValidate public_oe property

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