PHP Class TbActiveForm

Inheritance: extends CActiveForm
Exibir arquivo Open project: yinhe/yincart Class Usage Examples

Public Properties

Property Type Description
$inlineErrors flag that indicates if the errors should be displayed as blocks.
$input input class.
$type the form type. Allowed types are in TYPE_* constants

Public Methods

Method Description
captchaRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .captchaRow()
checkBoxGroupsList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string ### .checkBoxGroupsList()
checkBoxGroupsListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .checkBoxGroupsListRow()
checkBoxList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string ### .checkBoxList()
checkBoxListInlineRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .checkBoxListInlineRow()
checkBoxListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .checkBoxListRow()
checkBoxRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .checkBoxRow()
ckEditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .ckEditorRow()
colorpickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .colorpickerRow()
dateRangeRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .dateRangeRow()
datepickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .datepickerRow()
dropDownListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### dropDownListRow()
error ( CModel $model, string $attribute, array $htmlOptions = [], boolean $enableAjaxValidation = true, boolean $enableClientValidation = true ) : string ### .error()
errorSummary ( mixed $models, string $header = null, string $footer = null, array $htmlOptions = [] ) : string ### .errorSummary()
fileFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .fileFieldRow()
html5EditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .html5EditorRow()
init ( ) ### .init() Initializes the widget.
inputRow ( string $type, CModel $model, string $attribute, array $data = null, array $htmlOptions = [] ) : string ### .inputRow()
markdownEditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .markdownEditorRow()
maskedTextField ( CModel $model, string $attribute, array $mask, array $htmlOptions = [] ) : string Renders a masked text field row
maskedTextFieldRow ( CModel $model, string $attribute, array $mask, array $htmlOptions = [] ) : string ### .maskedTextFieldRow()
numberFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string Renders a number field input row.
passwordFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .passwordFieldRow()
radioButtonGroupsList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string ### .radioButtonGroupsList()
radioButtonGroupsListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .radioButtonGroupsListRow()
radioButtonList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string ### .radioButtonList()
radioButtonListInlineRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .radioButtonListInlineRow()
radioButtonListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string ### .radioButtonListRow()
radioButtonRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .radioButtonRow()
redactorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .redactorRow()
select2Row ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .select2Row()
textAreaRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .textAreaRow()
textFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .textFieldRow()
timepickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .timepickerRow()
toggleButtonRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .toggleButtonRow()
typeAheadField ( CModel $model, string $attribute, array $widgetOptions, array $htmlOptions = [] ) : string Renders a type ahead field row
typeAheadRow ( CModel $model, string $attribute, array $widgetOptions = [], array $htmlOptions = [] ) : string Renders a typeAhead input row
uneditableRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string ### .uneditableRow()

Protected Methods

Method Description
getInputClassName ( ) : string Returns the input widget class name suitable for the form.
inputsList ( boolean $checkbox, CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string Renders an input list.
renderError ( CModel $model, string $attribute, array $htmlOptions = [] ) : string Creates the HTML code wrapping the error text for given model attribute.

Method Details

captchaRow() public method

Renders a captcha row.
Since: 0.9.3
public captchaRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

checkBoxGroupsList() public method

Renders a checkbox list for a model attribute using Button Groups.
Since: 0.9.5
public checkBoxGroupsList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array value-label pairs used to generate the checkbox list.
$htmlOptions array additional HTML options.
return string the generated checkbox list

checkBoxGroupsListRow() public method

Renders a checkbox list input row using Button Groups.
public checkBoxGroupsListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

checkBoxList() public method

Renders a checkbox list for a model attribute. This method is a wrapper of {@link CHtml::activeCheckBoxList}. Please check {@link CHtml::activeCheckBoxList} for detailed information about the parameters for this method.
Since: 0.9.5
public checkBoxList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array value-label pairs used to generate the check box list.
$htmlOptions array additional HTML options.
return string the generated check box list

checkBoxListInlineRow() public method

Renders a checkbox list inline input row.
public checkBoxListInlineRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

checkBoxListRow() public method

Renders a checkbox list input row.
public checkBoxListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

checkBoxRow() public method

Renders a checkbox input row.
public checkBoxRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

ckEditorRow() public method

Renders a WYSIWYG ckeditor
public ckEditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array
return string

colorpickerRow() public method

Renders a colorpicker field row.
Since: 1.0.3 Booster
public colorpickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes. 'events' and 'options' key specify the events and configuration options of colorpicker respectively.
return string the generated row

dateRangeRow() public method

### .dateRangeRow()
public dateRangeRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array addition HTML attributes. In order to pass initialization parameters to dateRange, you need to set the HTML 'options' key with an array of configuration options.
return string

datepickerRow() public method

Renders a datepicker field row.
Since: 1.0.2 Booster
public datepickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes. 'events' and 'options' key specify the events and configuration options of datepicker respectively.
return string the generated row

dropDownListRow() public method

Renders a drop-down list input row.
public dropDownListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

error() public method

Displays the first validation error for a model attribute.
public error ( CModel $model, string $attribute, array $htmlOptions = [], boolean $enableAjaxValidation = true, boolean $enableClientValidation = true ) : string
$model CModel the data model
$attribute string the attribute name
$htmlOptions array additional HTML attributes to be rendered in the container div tag.
$enableAjaxValidation boolean whether to enable AJAX validation for the specified attribute.
$enableClientValidation boolean whether to enable client-side validation for the specified attribute.
return string the validation result (error display or success message).

errorSummary() public method

Displays a summary of validation errors for one or several models. This method is very similar to {@link CHtml::errorSummary} except that it also works when AJAX validation is performed.
See also: CHtml::errorSummary
public errorSummary ( mixed $models, string $header = null, string $footer = null, array $htmlOptions = [] ) : string
$models mixed the models whose input errors are to be displayed. This can be either a single model or an array of models.
$header string a piece of HTML code that appears in front of the errors
$footer string a piece of HTML code that appears at the end of the errors
$htmlOptions array additional HTML attributes to be rendered in the container div tag.
return string the error summary. Empty if no errors are found.

fileFieldRow() public method

Renders a file field input row.
public fileFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

getInputClassName() protected method

Returns the input widget class name suitable for the form.
protected getInputClassName ( ) : string
return string the class name

html5EditorRow() public method

Renders a WYSIWYG bootstrap editor
public html5EditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array
return string

init() public method

This renders the form open tag.
public init ( )

inputRow() public method

Creates an input row of a specific type. This is a generic factory method. It is mainly called by various helper methods which pass correct type definitions to it.
public inputRow ( string $type, CModel $model, string $attribute, array $data = null, array $htmlOptions = [] ) : string
$type string the input type
$model CModel the data model
$attribute string the attribute
$data array the data for list inputs
$htmlOptions array additional HTML attributes
return string the generated row

inputsList() protected method

Renders an input list.
Since: 0.9.5
protected inputsList ( boolean $checkbox, CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string
$checkbox boolean flag that indicates if the list is a checkbox-list.
$model CModel the data model
$attribute string the attribute
$data array value-label pairs used to generate the input list.
$htmlOptions array additional HTML options.
return string the generated input list.

markdownEditorRow() public method

Renders a WYSIWYG Markdown editor
public markdownEditorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array
return string

maskedTextField() public method

Renders a masked text field row
Since: 0.9.5
public maskedTextField ( CModel $model, string $attribute, array $mask, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$mask array the mask (see {@link http://digitalbush.com/projects/masked-input-plugin})
$htmlOptions array additional HTML options.
return string the generated masked text field

maskedTextFieldRow() public method

Renders a masked text field input row.
public maskedTextFieldRow ( CModel $model, string $attribute, array $mask, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$mask array the mask (see {@link http://digitalbush.com/projects/masked-input-plugin})
$htmlOptions array additional HTML attributes
return string the generated row

numberFieldRow() public method

Renders a number field input row.
public numberFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

passwordFieldRow() public method

Renders a password field input row.
public passwordFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

radioButtonGroupsList() public method

Renders a radio button list for a model attribute using Button Groups.
Since: 0.9.5
public radioButtonGroupsList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array value-label pairs used to generate the radio button list.
$htmlOptions array additional HTML options.
return string the generated radio button list

radioButtonGroupsListRow() public method

Renders a radio button list input row using Button Groups.
public radioButtonGroupsListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

radioButtonList() public method

Renders a radio button list for a model attribute. This method is a wrapper of {@link CHtml::activeRadioButtonList}. Please check {@link CHtml::activeRadioButtonList} for detailed information about the parameters for this method.
Since: 0.9.5
public radioButtonList ( CModel $model, string $attribute, array $data, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array value-label pairs used to generate the radio button list.
$htmlOptions array additional HTML options.
return string the generated radio button list

radioButtonListInlineRow() public method

Renders a radio button list inline input row.
public radioButtonListInlineRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

radioButtonListRow() public method

Renders a radio button list input row.
public radioButtonListRow ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$data array the list data
$htmlOptions array additional HTML attributes
return string the generated row

radioButtonRow() public method

Renders a radio button input row.
public radioButtonRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

redactorRow() public method

Renders a WYSIWYG redactor editor
public redactorRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array
return string

renderError() protected static method

Creates the HTML code wrapping the error text for given model attribute.
See also: CModel::getErrors
See also: errorMessageCss
protected static renderError ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute name
$htmlOptions array additional HTML attributes to be rendered in the container div tag.
return string the error display. Empty if no errors are found.

select2Row() public method

TODO: WTF is a input of type Select2? Rename it to something more meaningful! Renders a select2 field row
public select2Row ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel
$attribute string
$htmlOptions array
return string

textAreaRow() public method

Renders a text area input row.
public textAreaRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

textFieldRow() public method

Renders a text field input row.
public textFieldRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

timepickerRow() public method

Renders a timepicker field row.
Since: 0.10.0
public timepickerRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

toggleButtonRow() public method

Renders a toggle input row.
public toggleButtonRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes (options key sets the options for the toggle component)
return string the generated row

typeAheadField() public method

Renders a type ahead field row
Since: 1.0.6
public typeAheadField ( CModel $model, string $attribute, array $widgetOptions, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$widgetOptions array typeAhead options (see {@link http://twitter.github.com/bootstrap/javascript.html#typeahead})
$htmlOptions array additional HTML options.
return string the generated typeahead field

typeAheadRow() public method

Renders a typeAhead input row
public typeAheadRow ( CModel $model, string $attribute, array $widgetOptions = [], array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$widgetOptions array
$htmlOptions array additional HTML attributes
return string the generated row

uneditableRow() public method

Renders an uneditable text field row.
Since: 0.9.5
public uneditableRow ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute
$htmlOptions array additional HTML attributes
return string the generated row

Property Details

$inlineErrors public_oe property

flag that indicates if the errors should be displayed as blocks.
public $inlineErrors

$input public_oe property

input class.
public $input

$type public_oe property

the form type. Allowed types are in TYPE_* constants
public $type