Class NSelectBox
Select box control that allows single item selection.
- NObject
-
NComponent implements IComponent
-
NFormControl implements IFormControl
-
NSelectBox
Direct Known Subclasses
NMultiSelectBox
public
|
#
__construct(
string
$label = NULL,
array
$items = NULL,
int
$size = NULL
)
Parameters$label string label$items array items from which to choose$size int number of rows that should be visible |
public
mixed
|
#
getValue(
)
Returns selected item key. |
public
mixed
|
#
getRawValue(
)
Returns selected item key (not checked). Returns selected item key (not checked). |
public
NSelectBox
|
#
skipFirst(
string
$item = NULL
)
Ignores the first item in select box. Ignores the first item in select box. Parameters$item stringReturnsNSelectBox provides a fluent interface
|
final public
bool
|
#
isFirstSkipped(
)
Is first item in select box ignored? Is first item in select box ignored? |
final public
bool
|
#
areKeysUsed(
)
Are the keys used? Are the keys used? |
public
NSelectBox
|
#
setItems(
array
$items,
$useKeys = true
)
Sets items from which to choose. Sets items from which to choose. Parameters$items array$useKeys ReturnsNSelectBox provides a fluent interface
|
final public
array
|
#
getItems(
)
Returns items from which to choose. Returns items from which to choose. |
public
string
|
#
getSelectedItem(
)
Returns selected value. Returns selected value. |
public
NHtml
|
#
getControl(
)
Generates control's HTML element. Generates control's HTML element. |
public static
bool
|
#
validateFilled(
IFormControl
$control
)
Filled validator: has been any item selected? Filled validator: has been any item selected? Parameters$control IFormControl |
Methods Inherited From NFormControl
__construct(), attached(), getForm(), getHtmlName(), setHtmlId(), getHtmlId(), setAttribute(), setOption(), getOption(), getOptions(), setTranslator(), getTranslator(), translate(), setValue(), getValue(), setDefaultValue(), loadHttpData(), setDisabled(), isDisabled(), getControl(), getLabel(), getControlPrototype(), getLabelPrototype(), setRendered(), isRendered(), addRule(), addCondition(), addConditionOn(), getRules(), setRequired(), isRequired(), notifyRule(), validateEqual(), validateFilled(), validateValid(), addError(), getErrors(), hasErrors(), cleanErrors()
Methods Inherited From NComponent
__construct(), lookup(), lookupPath(), monitor(), unmonitor(), attached(), detached(), getName(), getParent(), setParent(), validateParent(), __clone(), __wakeup()
Methods Inherited From NObject
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
Constants Inherited From NComponent
NAME_SEPARATOR
protected
array
|
$allowed | array (
) |
# |
Properties Inherited From NFormControl
$idMask, $caption, $value, $control, $label