Class SelectBox (namespace Nette\Forms)


Select box control that allows single item selection.

Object
   |
   --Component
      |
      --FormControl
         |
         --SelectBox

Direct Known Sub-classes:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Forms/Controls/SelectBox.php (line 38)
Public Method Summary
SelectBox
__construct ([string $label = NULL], [$items = NULL], [int $size = NULL])
bool
Are the keys used?
Html
Generates control's HTML element.
array
Returns items from which to choose.
mixed
Returns selected item key (not checked).
string
Returns selected value.
mixed
Returns selected item key.
bool
Is first item in select box ignored?
SelectBox
setItems ($items, [$useKeys = TRUE])
Sets items from which to choose.
SelectBox
skipFirst ([string $item = NULL])
Ignores the first item in select box.
static bool
Filled validator: has been any item selected?
Methods Inherited From FormControl
__construct(), addCondition(), addConditionOn(), addError(), addRule(), attached(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDefaultValue(), setDisabled(), setHtmlId(), setOption(), setParent(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected array $allowed array()

line 44


Method Details

line 59

__construct

public SelectBox __construct ([string $label = NULL], [$items = NULL], [int $size = NULL])

Input
string $label label
$items items from which to choose
int $size number of rows that should be visible
Output
SelectBox  

line 136

areKeysUsed

public bool areKeysUsed ()

Are the keys used?

Output
bool  

line 211

getControl

public Html getControl ()

Generates control's HTML element.

Overridden in child classes as:

Output
Html  

line 183

getItems

public array getItems ()

Returns items from which to choose.

Output
array  

line 93

getRawValue

public mixed getRawValue ()

Returns selected item key (not checked).

Overridden in child classes as:

Output
mixed  

line 194

getSelectedItem

public string getSelectedItem ()

Returns selected value.

Overridden in child classes as:

Output
string  

line 77

getValue

public mixed getValue ()

Returns selected item key.

Overridden in child classes as:

Output
mixed  

line 125

isFirstSkipped

public bool isFirstSkipped ()

Is first item in select box ignored?

Output
bool  

line 148

setItems

public SelectBox setItems ($items, [$useKeys = TRUE])

Sets items from which to choose.

Input
$items
$useKeys
Output
SelectBox provides a fluent interface

line 105

skipFirst

public SelectBox skipFirst ([string $item = NULL])

Ignores the first item in select box.

Input
string $item
Output
SelectBox provides a fluent interface

line 249

validateFilled

public static bool validateFilled (IFormControl $control)

Filled validator: has been any item selected?

Input
IFormControl $control
Output
bool