Class CFormInputElement
CFormInputElement represents form input element.
CFormInputElement can represent the following types of form input based onCFormInputElement::$type
property:
- text: a normal text input generated using
CHtml::activeTextField()
- hidden: a hidden input generated using
CHtml::activeHiddenField()
- password: a password input generated using
CHtml::activePasswordField()
- textarea: a text area generated using
CHtml::activeTextArea()
- file: a file input generated using
CHtml::activeFileField()
- radio: a radio button generated using
CHtml::activeRadioButton()
- checkbox: a check box generated using
CHtml::activeCheckBox()
- listbox: a list box generated using
CHtml::activeListBox()
- dropdownlist: a drop-down list generated using
CHtml::activeDropDownList()
- checkboxlist: a list of check boxes generated using
CHtml::activeCheckBoxList()
- radiolist: a list of radio buttons generated using
CHtml::activeRadioButtonList()
- url: an HTML5 url input generated using
CHtml::activeUrlField()
- email: an HTML5 email input generated using
CHtml::activeEmailField()
- number: an HTML5 number input generated using
CHtml::activeNumberField()
- range: an HTML5 range input generated using
CHtml::activeRangeField()
- date: an HTML5 date input generated using
CHtml::activeDateField()
- time: an HTML5 time input generated using
CHtml::activeTimeField()
- datetime: an HTML5 datetime input generated using
CHtml::activeDateTimeField()
- datetimelocal: an HTML5 datetime-local input generated using
CHtml::activeDateTimeLocalField()
- week: an HTML5 week input generated using
CHtml::activeWeekField()
- color: an HTML5 color input generated using
CHtml::activeColorField()
- tel: an HTML5 tel input generated using
CHtml::activeTelField()
- search: an HTML5 search input generated using
CHtml::activeSearchField()
CFormInputElement::$type
property can also be a class name or a path alias to the
class. In this case, the input is generated using a widget of the specified
class. Note, the widget must have a property called "model" which expects a
model object, and a property called "attribute" which expects the name of a
model attribute.
Because CFormElement is an ancestor class of CFormInputElement, a value
assigned to a non-existing property will be stored in CFormElement::$attributes
which
will be passed as HTML attribute values to the CHtml
method generating
the input or initial values of the widget properties.
- CComponent
- CFormElement
- CFormInputElement
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.1
Located at x2engine/framework/web/form/CFormInputElement.php
public
boolean
|
#
getRequired( )
Gets the value indicating whether this input is required. If this property is
not set explicitly, it will be determined by calling |
public
|
|
public
string
|
|
public
|
|
public
string
|
#
render( )
Renders everything for this input. The default implementation simply returns
the result of |
public
string
|
#
renderLabel( )
Renders the label for this input. The default implementation returns the result of CHtml activeLabelEx. |
public
string
|
#
renderInput( )
Renders the input field. The default implementation returns the result of the appropriate CHtml method or the widget. |
public
string
|
#
renderError( )
Renders the error display of this input. The default implementation returns
the result of |
public
string
|
#
renderHint( )
Renders the hint text for this input. The default implementation returns the
|
protected
boolean
|
#
evaluateVisible( )
Evaluates the visibility of this element. This method will check if the attribute associated with this input is safe for the current model scenario. |
__construct(),
__get(),
__isset(),
__set(),
__toString(),
configure(),
getParent(),
getVisible(),
setVisible()
|
public static
array
|
$coreTypes | array(
'text'=>'activeTextField',
'hidden'=>'activeHiddenField',
'password'=>'activePasswordField',
'textarea'=>'activeTextArea',
'file'=>'activeFileField',
'radio'=>'activeRadioButton',
'checkbox'=>'activeCheckBox',
'listbox'=>'activeListBox',
'dropdownlist'=>'activeDropDownList',
'checkboxlist'=>'activeCheckBoxList',
'radiolist'=>'activeRadioButtonList',
'url'=>'activeUrlField',
'email'=>'activeEmailField',
'number'=>'activeNumberField',
'range'=>'activeRangeField',
'date'=>'activeDateField',
'time'=>'activeTimeField',
'datetime'=>'activeDateTimeField',
'datetimelocal'=>'activeDateTimeLocalField',
'week'=>'activeWeekField',
'color'=>'activeColorField',
'tel'=>'activeTelField',
'search'=>'activeSearchField',
) |
#
Core input types (alias=>CHtml method name) |
public
string
|
$type |
|
#
the type of this input. This can be a widget class name, a path alias of a
widget class name, or an input type alias (text, hidden, password, textarea,
file, radio, checkbox, listbox, dropdownlist, checkboxlist, or radiolist). If a
widget class, it must extend from |
public
string
|
$name |
|
#
name of this input |
public
string
|
$hint |
|
#
hint text of this input |
public
array
|
$items | array() |
#
the options for this input when it is a list box, drop-down list, check box
list, or radio button list. Please see |
public
array
|
$errorOptions | array() |
#
the options used when rendering the error part. This property will be passed
to the |
public
boolean
|
$enableAjaxValidation | true |
#
whether to allow AJAX-based validation for this input. Note that in order to
use AJAX-based validation, |
public
boolean
|
$enableClientValidation | true |
#
whether to allow client-side validation for this input. Note that in order to
use client-side validation, |
public
string
|
$layout | "{label}\n{input}\n{hint}\n{error}" |
#
the layout used to render label, input, hint and error. They correspond to the placeholders "{label}", "{input}", "{hint}" and "{error}". |
$attributes
|
public
boolean
|
$required |
#
Whether this input is required. |
public
string
|
$label |
#
The label for this input. If the label is not manually set, this method will
call |
$parent,
$visible
|