namespace Nette\Forms
Class FormContainer
Container for form controls.
- Nette\Object
-
Nette\Component implements Nette\IComponent
-
Nette\ComponentContainer implements Nette\IComponentContainer
-
Nette\Forms\FormContainer implements ArrayAccess
Direct Known Subclasses
Form
public
FormContainer
|
#
setDefaults(
array|Traversable
$values,
bool
$erase = false
)
Fill-in with default values. Fill-in with default values. Parameters$values array|Traversable values used to fill the form$erase bool erase other default values?ReturnsFormContainer provides a fluent interface
|
public
FormContainer
|
#
setValues(
array|Traversable
$values,
bool
$erase = false
)
Fill-in with values. Fill-in with values. Parameters$values array|Traversable values used to fill the form$erase bool erase other controls?ReturnsFormContainer provides a fluent interface
|
public
array
|
#
getValues(
)
Returns the values submitted by the form. Returns the values submitted by the form. |
public
bool
|
#
isValid(
)
Is form valid? Is form valid? |
public
void
|
#
validate(
)
Performs the server side validation. Performs the server side validation. |
public
FormContainer
|
#
setCurrentGroup(
FormGroup
$group = NULL
)
Parameters$group FormGroupReturnsFormContainer provides a fluent interface
|
public
FormGroup
|
#
getCurrentGroup(
)
Returns current group. Returns current group. |
public
void
|
#
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 stringThrowsImplementation of |
public
\ArrayIterator
|
#
getControls(
)
Iterates over all form controls. Iterates over all form controls. |
public
Form
|
#
getForm(
bool
$need = true
)
Returns form. Returns form. Parameters$need bool throw exception if form doesn't exist? |
public
TextInput
|
#
addText(
string
$name,
string
$label = NULL,
int
$cols = NULL,
int
$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 int width of the control$maxLength int maximum number of characters the user may enter |
public
TextInput
|
#
addPassword(
string
$name,
string
$label = NULL,
int
$cols = NULL,
int
$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 int width of the control$maxLength int maximum number of characters the user may enter |
public
TextArea
|
#
addTextArea(
string
$name,
string
$label = NULL,
int
$cols = 40,
int
$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 int width of the control$rows int height of the control in text lines |
public
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 |
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 |
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 |
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 |
public
SelectBox
|
#
addSelect(
string
$name,
string
$label = NULL,
array
$items = NULL,
int
$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 int number of rows that should be visible |
public
MultiSelectBox
|
#
addMultiSelect(
string
$name,
string
$label = NULL,
array
$items = NULL,
int
$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 int number of rows that should be visible |
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 |
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 |
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 |
public
FormContainer
|
#
addContainer(
string
$name
)
Adds naming container to the form. Adds naming container to the form. Parameters$name string name |
final public
void
|
#
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\IComponentImplementation of |
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 nameThrowsImplementation of |
final public
bool
|
#
offsetExists(
string
$name
)
Does component specified by name exists? Does component specified by name exists? Parameters$name string component nameImplementation of |
final public
void
|
#
offsetUnset(
string
$name
)
Removes component from the container. Removes component from the container. Parameters$name string component nameImplementation of |
final public
|
#
__clone(
)
Prevents cloning. Prevents cloning. |
Methods Inherited From Nette\ComponentContainer
addComponent(), removeComponent(), getComponent(), createComponent(), getComponents(), validateChildComponent(), __clone()
Methods Inherited From Nette\Component
__construct(), lookup(), lookupPath(), monitor(), unmonitor(), attached(), detached(), getName(), getParent(), setParent(), validateParent(), __clone(), __wakeup()
Methods Inherited From Nette\Object
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
Constants Inherited From Nette\Component
NAME_SEPARATOR