PHP Class TbActiveForm

Inheritance: extends CActiveForm
Afficher le fichier Open project: yinhe/yincart Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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()

Méthodes protégées

Méthode 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 méthode

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
Résultat string the generated row

checkBoxGroupsList() public méthode

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.
Résultat string the generated checkbox list

checkBoxGroupsListRow() public méthode

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
Résultat string the generated row

checkBoxList() public méthode

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.
Résultat string the generated check box list

checkBoxListInlineRow() public méthode

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
Résultat string the generated row

checkBoxListRow() public méthode

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
Résultat string the generated row

checkBoxRow() public méthode

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
Résultat string the generated row

ckEditorRow() public méthode

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

colorpickerRow() public méthode

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.
Résultat string the generated row

dateRangeRow() public méthode

### .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.
Résultat string

datepickerRow() public méthode

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.
Résultat string the generated row

dropDownListRow() public méthode

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
Résultat string the generated row

error() public méthode

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.
Résultat string the validation result (error display or success message).

errorSummary() public méthode

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.
Résultat string the error summary. Empty if no errors are found.

fileFieldRow() public méthode

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
Résultat string the generated row

getInputClassName() protected méthode

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

html5EditorRow() public méthode

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

init() public méthode

This renders the form open tag.
public init ( )

inputRow() public méthode

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
Résultat string the generated row

inputsList() protected méthode

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.
Résultat string the generated input list.

markdownEditorRow() public méthode

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

maskedTextField() public méthode

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.
Résultat string the generated masked text field

maskedTextFieldRow() public méthode

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
Résultat string the generated row

numberFieldRow() public méthode

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
Résultat string the generated row

passwordFieldRow() public méthode

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
Résultat string the generated row

radioButtonGroupsList() public méthode

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.
Résultat string the generated radio button list

radioButtonGroupsListRow() public méthode

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
Résultat string the generated row

radioButtonList() public méthode

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.
Résultat string the generated radio button list

radioButtonListInlineRow() public méthode

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
Résultat string the generated row

radioButtonListRow() public méthode

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
Résultat string the generated row

radioButtonRow() public méthode

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
Résultat string the generated row

redactorRow() public méthode

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

renderError() protected static méthode

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.
Résultat string the error display. Empty if no errors are found.

select2Row() public méthode

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
Résultat string

textAreaRow() public méthode

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
Résultat string the generated row

textFieldRow() public méthode

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
Résultat string the generated row

timepickerRow() public méthode

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
Résultat string the generated row

toggleButtonRow() public méthode

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)
Résultat string the generated row

typeAheadField() public méthode

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.
Résultat string the generated typeahead field

typeAheadRow() public méthode

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
Résultat string the generated row

uneditableRow() public méthode

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
Résultat 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