Overview

Packages

  • bootstrap
    • behaviors
    • components
    • form
    • gii
    • helpers
    • widgets

Classes

  • TbActiveForm
  • TbAffix
  • TbAlert
  • TbBreadcrumb
  • TbButtonColumn
  • TbCollapse
  • TbDataColumn
  • TbDetailView
  • TbGridView
  • TbHeroUnit
  • TbListView
  • TbModal
  • TbNav
  • TbNavbar
  • TbPager
  • TbScrollspy
  • TbTabs
  • TbThumbnails
  • TbTypeAhead
  • Overview
  • Package
  • Class
  • Tree

Class TbActiveForm

Bootstrap active form widget.

CActiveForm
Extended by TbActiveForm
Package: bootstrap\widgets
Copyright: Copyright © Christoffer Niska 2013-
License: New BSD License
Author: Antonio Ramirez <ramirez.cobos@gmail.com>
Located at widgets/TbActiveForm.php
Methods summary
public
# init( )

Initializes the widget.

Initializes the widget.

public string
# error( CModel $model, string $attribute, array $htmlOptions = array(), boolean $enableAjaxValidation = true, boolean $enableClientValidation = true )

Displays the first validation error for a model attribute.

Displays the first validation error for a model attribute.

Parameters

$model
CModel
$model the data model
$attribute
string
$attribute the attribute name
$htmlOptions
array
$htmlOptions additional HTML attributes to be rendered in the container div tag.
$enableAjaxValidation
boolean
$enableAjaxValidation whether to enable AJAX validation for the specified attribute.
$enableClientValidation
boolean
$enableClientValidation whether to enable client-side validation for the specified attribute.

Returns

string
the validation result (error display or success message).
public string
# errorSummary( mixed $models, string $header = null, string $footer = null, array $htmlOptions = array() )

Displays a summary of validation errors for one or several models.

Displays a summary of validation errors for one or several models.

Parameters

$models
mixed
$models the models whose input errors are to be displayed.
$header
string
$header a piece of HTML code that appears in front of the errors
$footer
string
$footer a piece of HTML code that appears at the end of the errors
$htmlOptions
array
$htmlOptions additional HTML attributes to be rendered in the container div tag.

Returns

string
the error summary. Empty if no errors are found.
public string
# textField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a text field for a model attribute.

Generates a text field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.

See

TbHtml::activeTextField()
public string
# passwordField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a password field for a model attribute.

Generates a password field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.

See

TbHtml::activePasswordField()
public string
# urlField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates an url field for a model attribute.

Generates an url field for a model attribute.

Parameters

$model
CModel
$model the data model
$attribute
string
$attribute the attribute
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field

See

TbHtml::activeUrlField()
public string
# emailField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates an email field for a model attribute.

Generates an email field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.

See

TbHtml::activeEmailField()
public string
# numberField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a number field for a model attribute.

Generates a number field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.

See

TbHtml::activeNumberField()
public string
# rangeField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a range field for a model attribute.

Generates a range field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.

See

TbHtml::activeRangeField()
public string
# dateField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a date field for a model attribute.

Generates a date field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input field.
public string
# textArea( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a text area for a model attribute.

Generates a text area for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated text area.

See

TbHtml::activeTextArea()
public string
# fileField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a file field for a model attribute.

Generates a file field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes

Returns

string
the generated input field.

See

TbHtml::activeFileField()
public string
# radioButton( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a radio button for a model attribute.

Generates a radio button for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated radio button.

See

TbHtml::activeRadioButton()
public string
# checkBox( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a checkbox for a model attribute.

Generates a checkbox for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated check box.

See

TbHtml::activeCheckBox()
public string
# dropDownList( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a dropdown list for a model attribute.

Generates a dropdown list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated drop down list.

See

TbHtml::activeDropDownList()
public string
# listBox( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a list box for a model attribute.

Generates a list box for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated list box.

See

TbHtml::activeListBox()
public string
# radioButtonList( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a radio button list for a model attribute

Generates a radio button list for a model attribute

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display)
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated radio button list.

See

TbHtml::activeRadioButtonList()
public string
# inlineRadioButtonList( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates an inline radio button list for a model attribute

Generates an inline radio button list for a model attribute

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display)
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated radio button list.

See

TbHtml::activeInlineRadioButtonList()
public string
# checkBoxList( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a checkbox list for a model attribute.

Generates a checkbox list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display)
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated checkbox list.

See

TbHtml::activeCheckBoxList()
public string
# inlineCheckBoxList( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates an inline checkbox list for a model attribute.

Generates an inline checkbox list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$data
array
$data data for generating the list options (value=>display)
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated checkbox list.

See

TbHtml::activeInlineCheckBoxList()
public string
# uneditableField( CModel $model, string $attribute, array $htmlOptions = array() )

Generates an uneditable field for a model attribute.

Generates an uneditable field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated field.

See

TbHtml::activeUneditableField()
public string
# searchQuery( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a search query field for a model attribute.

Generates a search query field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated input.

See

TbHtml::activeSearchField
public string
# createInput( string $type, CModel $model, string $attribute, array $htmlOptions = array(), array $data = array() )

Generates an input for a model attribute.

Generates an input for a model attribute.

Parameters

$type
string
$type the input type.
$model
CModel
$model the data model.
$attribute
string
$attribute the attribute.
$htmlOptions
array
$htmlOptions additional HTML attributes.
$data
array
$data data for generating the list options (value=>display).

Returns

string
the generated input.

See

TbHtml::createActiveInput()
public string
# textFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a text field for a model attribute.

Generates a control group with a text field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeTextFieldControlGroup()
public string
# passwordFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a password field for a model attribute.

Generates a control group with a password field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activePasswordFieldControlGroup()
public string
# urlFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with an url field for a model attribute.

Generates a control group with an url field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeUrlFieldControlGroup()
public string
# emailFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with an email field for a model attribute.

Generates a control group with an email field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeEmailFieldControlGroup()
public string
# numberFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a number field for a model attribute.

Generates a control group with a number field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeNumberFieldControlGroup()
public string
# rangeFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a range field for a model attribute.

Generates a control group with a range field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeRangeFieldControlGroup()
public string
# dateFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a date field for a model attribute.

Generates a control group with a date field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeDateFieldControlGroup()
public string
# textAreaControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a text area for a model attribute.

Generates a control group with a text area for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeTextAreaControlGroup()
public string
# checkBoxControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a check box for a model attribute.

Generates a control group with a check box for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeCheckBoxControlGroup()
public string
# radioButtonControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a radio button for a model attribute.

Generates a control group with a radio button for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeRadioButtonControlGroup()
public string
# dropDownListControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with a drop down list for a model attribute.

Generates a control group with a drop down list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeDropDownListControlGroup()
public string
# listBoxControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with a list box for a model attribute.

Generates a control group with a list box for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeListBoxControlGroup()
public string
# fileFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a file field for a model attribute.

Generates a control group with a file field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeFileFieldControlGroup()
public string
# radioButtonListControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with a radio button list for a model attribute.

Generates a control group with a radio button list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeRadioButtonListControlGroup()
public string
# inlineRadioButtonListControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with an inline radio button list for a model attribute.

Generates a control group with an inline radio button list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeInlineCheckBoxListControlGroup()
public string
# checkBoxListControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with a check box list for a model attribute.

Generates a control group with a check box list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeCheckBoxListControlGroup()
public string
# inlineCheckBoxListControlGroup( CModel $model, string $attribute, array $data, array $htmlOptions = array() )

Generates a control group with an inline check box list for a model attribute.

Generates a control group with an inline check box list for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$data
array
$data data for generating the list options (value=>display).
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeInlineCheckBoxListControlGroup()
public string
# uneditableFieldControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with an uneditable field for a model attribute.

Generates a control group with an uneditable field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeUneditableFieldControlGroup()
public string
# searchQueryControlGroup( CModel $model, string $attribute, array $htmlOptions = array() )

Generates a control group with a search field for a model attribute.

Generates a control group with a search field for a model attribute.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.

Returns

string
the generated control group.

See

TbHtml::activeSearchFieldControlGroup
public string
# createControlGroup( string $type, CModel $model, string $attribute, array $htmlOptions = array(), array $data = array() )

Generates a control group for a model attribute.

Generates a control group for a model attribute.

Parameters

$type
string
$type the input type.
$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$htmlOptions
array
$htmlOptions additional HTML attributes.
$data
array
$data data for generating the list options (value=>display).

Returns

string
the generated control group.

See

TbHtml::activeControlGroup()
protected array
# processControlGroupOptions( CModel $model, string $attribute, array $options )

Processes the options for a input row.

Processes the options for a input row.

Parameters

$model
CModel
$model the data model.
$attribute
string
$attribute the attribute name.
$options
array
$options the options.

Returns

array
the processed options.
Properties summary
public string $layout
#

the form layout.

the form layout.

public string $helpType TbHtml::HELP_TYPE_BLOCK
#

the help type. Valid values are TbHtml::HELP_INLINE and TbHtml::HELP_BLOCK.

the help type. Valid values are TbHtml::HELP_INLINE and TbHtml::HELP_BLOCK.

public string $errorMessageCssClass 'error'
#

the CSS class name for error messages.

the CSS class name for error messages.

public string $successMessageCssClass 'success'
#

the CSS class name for success messages.

the CSS class name for success messages.

public boolean $hideInlineErrors false
#

whether to hide inline errors. Defaults to false.

whether to hide inline errors. Defaults to false.

Yiistrap API documentation generated by ApiGen 2.8.0