Methods summary
public
|
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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.
|