\TbInput

## Bootstrap input widget.

Used for rendering inputs according to Bootstrap standards.

Summary

Methods
Properties
Constants
init()
run()
$form
$label
$type
$data
$prependText
$appendText
$hintText
$labelOptions
$prependOptions
$appendOptions
$hintOptions
$errorOptions
$captchaOptions
$enableAjaxValidation
$enableClientValidation
TYPE_CHECKBOX
TYPE_CHECKBOXLIST
TYPE_CHECKBOXLIST_INLINE
TYPE_CHECKBOXGROUPSLIST
TYPE_DROPDOWN
TYPE_FILE
TYPE_PASSWORD
TYPE_PASSFIELD
TYPE_RADIO
TYPE_RADIOLIST
TYPE_RADIOLIST_INLINE
TYPE_RADIOBUTTONGROUPSLIST
TYPE_TEXTAREA
TYPE_TEXT
TYPE_MASKEDTEXT
TYPE_CAPTCHA
TYPE_UNEDITABLE
TYPE_DATEPICKER
TYPE_DATETIMEPICKER
TYPE_REDACTOR
TYPE_MARKDOWNEDITOR
TYPE_HTML5EDITOR
TYPE_DATERANGEPICKER
TYPE_TOGGLEBUTTON
TYPE_COLORPICKER
TYPE_CKEDITOR
TYPE_TIMEPICKER
TYPE_SELECT2
TYPE_TYPEAHEAD
TYPE_NUMBER
TYPE_CUSTOM
processHtmlOptions()
getLabel()
getPrepend()
getAppend()
getAttributeId()
getError()
getHint()
getContainerCssClass()
getAddonCssClass()
hasAddOn()
checkBox()
toggleButton()
checkBoxList()
checkBoxListInline()
checkBoxGroupsList()
dropDownList()
fileField()
passwordField()
passfieldField()
radioButton()
radioButtonList()
radioButtonListInline()
radioButtonGroupsList()
textArea()
textField()
maskedTextField()
captcha()
uneditableField()
datepickerField()
datetimepickerField()
redactorJs()
markdownEditorJs()
ckEditor()
html5Editor()
dateRangeField()
colorpickerField()
timepickerField()
select2Field()
typeAheadField()
numberField()
customField()
getSeparatedSelectableInput()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_CHECKBOX

TYPE_CHECKBOX

TYPE_CHECKBOXLIST

TYPE_CHECKBOXLIST

TYPE_CHECKBOXLIST_INLINE

TYPE_CHECKBOXLIST_INLINE

TYPE_CHECKBOXGROUPSLIST

TYPE_CHECKBOXGROUPSLIST

TYPE_DROPDOWN

TYPE_DROPDOWN

TYPE_FILE

TYPE_FILE

TYPE_PASSWORD

TYPE_PASSWORD

TYPE_PASSFIELD

TYPE_PASSFIELD

TYPE_RADIO

TYPE_RADIO

TYPE_RADIOLIST

TYPE_RADIOLIST

TYPE_RADIOLIST_INLINE

TYPE_RADIOLIST_INLINE

TYPE_RADIOBUTTONGROUPSLIST

TYPE_RADIOBUTTONGROUPSLIST

TYPE_TEXTAREA

TYPE_TEXTAREA

TYPE_TEXT

TYPE_TEXT

TYPE_MASKEDTEXT

TYPE_MASKEDTEXT

TYPE_CAPTCHA

TYPE_CAPTCHA

TYPE_UNEDITABLE

TYPE_UNEDITABLE

TYPE_DATEPICKER

TYPE_DATEPICKER

TYPE_DATETIMEPICKER

TYPE_DATETIMEPICKER

TYPE_REDACTOR

TYPE_REDACTOR

TYPE_MARKDOWNEDITOR

TYPE_MARKDOWNEDITOR

TYPE_HTML5EDITOR

TYPE_HTML5EDITOR

TYPE_DATERANGEPICKER

TYPE_DATERANGEPICKER

TYPE_TOGGLEBUTTON

TYPE_TOGGLEBUTTON

TYPE_COLORPICKER

TYPE_COLORPICKER

TYPE_CKEDITOR

TYPE_CKEDITOR

TYPE_TIMEPICKER

TYPE_TIMEPICKER

TYPE_SELECT2

TYPE_SELECT2

TYPE_TYPEAHEAD

TYPE_TYPEAHEAD

TYPE_NUMBER

TYPE_NUMBER

TYPE_CUSTOM

TYPE_CUSTOM

Properties

$form

$form : \TbActiveForm

Type

\TbActiveForm — the associated form widget.

$label

$label : string

Type

string — the input label text.

$type

$type : string

Type

string — the input type. Following types are supported: checkbox, checkboxlist, dropdownlist, filefield, password, radiobutton, radiobuttonlist, textarea, textfield, captcha and uneditable.

$data

$data : array

Type

array — the data for list inputs.

$prependText

$prependText : string

Type

string — text to prepend.

$appendText

$appendText : string

Type

string — text to append.

$hintText

$hintText : string

Type

string — the hint text.

$labelOptions

$labelOptions : array

Type

array — label html attributes.

$prependOptions

$prependOptions : array

Type

array — prepend html attributes.

$appendOptions

$appendOptions : array

Type

array — append html attributes.

$hintOptions

$hintOptions : array

Type

array — hint html attributes.

$errorOptions

$errorOptions : array

Type

array — error html attributes.

$captchaOptions

$captchaOptions : array

Type

array — captcha html attributes.

$enableAjaxValidation

$enableAjaxValidation : boolean

This property allows you to disable AJAX valiadtion for certain fields within a form.

Type

boolean — the value to be set as fourth parameter to {@link CActiveForm::error}.

$enableClientValidation

$enableClientValidation : boolean

This property allows you to disable client valiadtion for certain fields within a form.

Type

boolean — the value to be set as fifth parameter to {@link CActiveForm::error}.

Methods

init()

init()

### .init()

Initializes the widget.

Throws

\CException

if the widget could not be initialized.

run()

run()

### .run()

Runs the widget.

Throws

\CException

if the widget type is invalid.

processHtmlOptions()

processHtmlOptions()

### .processHtmlOptions()

Processes the html options.

getLabel()

getLabel() : string

### .getLabel()

Returns the label for the input.

Returns

string —

the label

getPrepend()

getPrepend() : string

### .getPrepend()

Returns the prepend element for the input.

Returns

string —

the element

getAppend()

getAppend() : string

### .getAppend()

Returns the append element for the input.

Returns

string —

the element

getAttributeId()

getAttributeId(string $attribute) : string

### .getAppend()

Returns the id that should be used for the specified attribute

Parameters

string $attribute

the attribute

Returns

string —

the id

getError()

getError() : string

### .getError()

Returns the error text for the input.

Returns

string —

the error text

getHint()

getHint() : string

### .getHint()

Returns the hint text for the input.

Returns

string —

the hint text

getContainerCssClass()

getContainerCssClass() : string

### .getContainerCssClass()

Returns the container CSS class for the input.

Returns

string —

the CSS class

getAddonCssClass()

getAddonCssClass() : string

### .getAddonCssClass()

Returns the input container CSS classes.

Returns

string —

the CSS class

hasAddOn()

hasAddOn() : boolean

### .hasAddOn()

Returns whether the input has an add-on (prepend and/or append).

Returns

boolean —

the result

checkBox()

checkBox() : string

### .checkBox()

Renders a checkbox.

Returns

string —

the rendered content

toggleButton()

toggleButton() : string

### .toggleButton()

Renders a toggle button.

Returns

string —

the rendered content

checkBoxList()

checkBoxList() : string

### .checkBoxList()

Renders a list of checkboxes.

Returns

string —

the rendered content

checkBoxListInline()

checkBoxListInline() : string

### .checkBoxListInline()

Renders a list of inline checkboxes.

Returns

string —

the rendered content

checkBoxGroupsList()

checkBoxGroupsList() : string

### .checkBoxGroupsList()

Renders a list of checkboxes using Button Groups.

Returns

string —

the rendered content

dropDownList()

dropDownList() : string

### .dropDownList()

Renders a drop down list (select).

Returns

string —

the rendered content

fileField()

fileField() : string

### .fileField()

Renders a file field.

Returns

string —

the rendered content

passwordField()

passwordField() : string

### .passwordField()

Renders a password field.

Returns

string —

the rendered content

passfieldField()

passfieldField() : string

### .passfieldField()

Renders a Pass*Field field.

Returns

string —

the rendered content

radioButton()

radioButton() : string

### .radioButton()

Renders a radio button.

Returns

string —

the rendered content

radioButtonList()

radioButtonList() : string

### .radioButtonList()

Renders a list of radio buttons.

Returns

string —

the rendered content

radioButtonListInline()

radioButtonListInline() : string

### .radioButtonListInline()

Renders a list of inline radio buttons.

Returns

string —

the rendered content

radioButtonGroupsList()

radioButtonGroupsList() : string

### .radioButtonGroupsList()

Renders a list of radio buttons using Button Groups.

Returns

string —

the rendered content

textArea()

textArea() : string

### .textArea()

Renders a textarea.

Returns

string —

the rendered content

textField()

textField() : string

### .textField()

Renders a text field.

Returns

string —

the rendered content

maskedTextField()

maskedTextField() : string

### .maskedTextField()

Renders a masked text field.

Returns

string —

the rendered content

captcha()

captcha() : string

### .captcha()

Renders a CAPTCHA.

Returns

string —

the rendered content

uneditableField()

uneditableField() : string

### .uneditableField()

Renders an uneditable field.

Returns

string —

the rendered content

datepickerField()

datepickerField() : string

### .datepicketField()

Renders a datepicker field.

Returns

string —

the rendered content

datetimepickerField()

datetimepickerField() : string

### .datetimepicketField()

Renders a datetimepicker field.

Returns

string —

the rendered content

redactorJs()

redactorJs() : mixed

### .redactorJs()

Renders a redactorJS wysiwyg field.

Returns

mixed

markdownEditorJs()

markdownEditorJs() : mixed

### .markdownEditorJs()

Renders a markdownEditorJS wysiwyg field.

Returns

mixed

ckEditor()

ckEditor() : mixed

### .ckEditor()

Renders a bootstrap CKEditor wysiwyg editor.

Returns

mixed

html5Editor()

html5Editor() : mixed

### .html5Editor()

Renders a bootstrap wysihtml5 editor.

Returns

mixed

dateRangeField()

dateRangeField() : mixed

### .dateRangeField()

Renders a daterange picker field

Returns

mixed

colorpickerField()

colorpickerField() : string

### .colorpickerField()

Renders a colorpicker field.

Returns

string —

the rendered content

timepickerField()

timepickerField() : string

### .timepickerField()

Renders a timepicker field.

Returns

string —

the rendered content

select2Field()

select2Field() : mixed

### .select2Field()

Renders a select2 field.

Returns

mixed

typeAheadField()

typeAheadField() : mixed

Renders a typeAhead field.

Returns

mixed

numberField()

numberField() : string

### . numberField()

Renders a number field.

Returns

string —

the rendered content

customField()

customField() : string

### . customField()

Renders a pre-rendered custom field.

Returns

string —

the rendered content

getSeparatedSelectableInput()

getSeparatedSelectableInput() : array

Obtain separately hidden and visible field

Throws

\CException

Returns

array