Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • Button
  • Checkbox
  • ConventionalRenderer
  • FileUpload
  • Form
  • FormContainer
  • FormControl
  • FormGroup
  • HiddenField
  • ImageButton
  • InstantClientScript
  • MultiSelectBox
  • RadioList
  • Rule
  • Rules
  • SelectBox
  • SubmitButton
  • TextArea
  • TextBase
  • TextInput

Interfaces

  • IFormControl
  • IFormRenderer
  • INamingContainer
  • ISubmitterControl
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class SelectBox

Select box control that allows single item selection.

Nette\Object
Extended by Nette\Component implements Nette\IComponent
Extended by Nette\Forms\FormControl implements Nette\Forms\IFormControl
Extended by Nette\Forms\SelectBox

Direct known subclasses

Nette\Forms\MultiSelectBox
Namespace: Nette\Forms
Author: David Grudl
Located at Forms/Controls/SelectBox.php
Methods summary
public
# __construct( string $label = NULL, array $items = NULL, integer $size = NULL )

Parameters

$label
string
label
$items
array
items from which to choose
$size
integer
number of rows that should be visible
public mixed
# getValue( )

Returns selected item key.

Returns selected item key.

Returns

mixed

Implementation of

Nette\Forms\IFormControl::getValue
public mixed
# getRawValue( )

Returns selected item key (not checked).

Returns selected item key (not checked).

Returns

mixed
public Nette\Forms\SelectBox
# skipFirst( string $item = NULL )

Ignores the first item in select box.

Ignores the first item in select box.

Parameters

$item
string

Returns

Nette\Forms\SelectBox
provides a fluent interface
final public boolean
# isFirstSkipped( )

Is first item in select box ignored?

Is first item in select box ignored?

Returns

boolean
final public boolean
# areKeysUsed( )

Are the keys used?

Are the keys used?

Returns

boolean
public Nette\Forms\SelectBox
# setItems( array $items, $useKeys = TRUE )

Sets items from which to choose.

Sets items from which to choose.

Parameters

$items
array
$useKeys

Returns

Nette\Forms\SelectBox
provides a fluent interface
final public array
# getItems( )

Returns items from which to choose.

Returns items from which to choose.

Returns

array
public string
# getSelectedItem( )

Returns selected value.

Returns selected value.

Returns

string
public Nette\Web\Html
# getControl( )

Generates control's HTML element.

Generates control's HTML element.

Returns

Nette\Web\Html
public static boolean
# validateFilled( Nette\Forms\IFormControl $control )

Filled validator: has been any item selected?

Filled validator: has been any item selected?

Parameters

$control
Nette\Forms\IFormControl

Returns

boolean
Methods inherited from Nette\Forms\FormControl
addCondition(), addConditionOn(), addError(), addRule(), attached(), cleanErrors(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), hasErrors(), isDisabled(), loadHttpData(), notifyRule(), setDefaultValue(), setDisabled(), setHtmlId(), setOption(), setTranslator(), setValue(), translate(), validateEqual(), validateValid()
Methods inherited from Nette\Component
__clone(), __wakeup(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent()
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\IComponent
NAME_SEPARATOR
Properties summary
protected array $allowed array()
#
Properties inherited from Nette\Forms\FormControl
$caption, $control, $idMask, $label, $value
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0