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 34)
Public Method Summary
SelectBox
__construct (string $label, [$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 ([bool $value = TRUE])
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(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDisabled(), setHtmlId(), setOption(), setParent(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), getService(), getServiceLocator(), lookup(), lookupPath(), monitor(), setParent(), setServiceLocator(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected array $allowed array()

line 40


Method Details

line 55

__construct

public SelectBox __construct (string $label, [$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 124

areKeysUsed

public bool areKeysUsed ()

Are the keys used?

Output
bool  

line 199

getControl

public Html getControl ()

Generates control's HTML element.

Overridden in child classes as:

Output
Html  

line 171

getItems

public array getItems ()

Returns items from which to choose.

Output
array  

line 89

getRawValue

public mixed getRawValue ()

Returns selected item key (not checked).

Overridden in child classes as:

Output
mixed  

line 182

getSelectedItem

public string getSelectedItem ()

Returns selected value.

Overridden in child classes as:

Output
string  

line 73

getValue

public mixed getValue ()

Returns selected item key.

Overridden in child classes as:

Output
mixed  

line 113

isFirstSkipped

public bool isFirstSkipped ()

Is first item in select box ignored?

Output
bool  

line 136

setItems

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

Sets items from which to choose.

Input
$items
$useKeys
Output
SelectBox provides a fluent interface

line 101

skipFirst

public SelectBox skipFirst ([bool $value = TRUE])

Ignores the first item in select box.

Input
bool $value
Output
SelectBox provides a fluent interface

line 237

validateFilled

public static bool validateFilled (IFormControl $control)

Filled validator: has been any item selected?

Input
IFormControl $control
Output
bool