Public Member Functions | |
__construct ($model, $attribute, $form=null, array $params=array()) | |
render () | |
getEditableNameIds () | |
getAttribute () | |
renderAsControlNonEditable () | |
Static Public Member Functions | |
static | getDisplayName () |
static | isReadOnly () |
static | resolveInputNameForEditableInput ($attributeName) |
static | resolveInputNamePrefixIntoString ($inputNamePrefix) |
static | resolveInputIdPrefixIntoString ($inputIdPrefix) |
Data Fields | |
$params | |
$editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}{error}</td>' | |
$nonEditableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}</td>' | |
Protected Member Functions | |
renderLabel () | |
resolveIdForLabel () | |
getFormattedAttributeLabel () | |
resolveNonActiveFormFormattedLabel ($label) | |
renderError () | |
renderScopedErrorId ($inputNameIdPrefix, $attribute) | |
renderEditable () | |
renderNonEditable () | |
renderControlEditable () | |
renderControlNonEditable () | |
getColumnSpan () | |
getDisabledValue () | |
getHtmlOptions () | |
resolveContentTemplate ($template, $data) | |
getEditableInputId ($attributeName=null, $relationAttributeName=null) | |
getEditableInputName ($attributeName=null, $relationAttributeName=null) | |
resolveInputPrefix () | |
resolveInputIdPrefix () | |
resolveInputNamePrefix () | |
getListViewGridId () | |
Protected Attributes | |
$model | |
$attribute | |
$form | |
Abstraction of the various view elements. Examples include Text fields, checkboxes, and date fields.
Element can render an editable or non-editable version and will populate information based on the provided attribute and model.
Definition at line 44 of file Element.php.
__construct | ( | $model, | |
$attribute, | |||
$form = null , |
|||
array | $params = array() |
||
) |
Constructs the element specifying the model and attribute. In the case of needing to show editable information, a form is also provided.
$form | Optional. If supplied an editable element will be rendered. |
$params | Can have additional parameters for use. 'wide' true or false is an example parameter |
Definition at line 66 of file Element.php.
render | ( | ) |
Generates the element content.
Definition at line 80 of file Element.php.
|
protected |
Generate the element label content
Definition at line 94 of file Element.php.
|
protected |
Generate the error content. Used by editable content
Definition at line 139 of file Element.php.
|
protected |
For related models such as Email, Address, and CurrencyValue, a scoped error id is required. This is because we treat those related attributes effectively on the base model for showing validation errors.
string | $inputNameIdPrefix | |
string | $attribute |
Definition at line 152 of file Element.php.
|
protected |
Generate editable version of the element includes the lable, control, and error content
Definition at line 164 of file Element.php.
|
protected |
Generate non-editable version of the element includes label and control elements
Definition at line 179 of file Element.php.
|
protected |
Determines correct column span based on params 'wide' value
Definition at line 195 of file Element.php.
getEditableNameIds | ( | ) |
Get the collection of id/names of inputs and other parts of the element.
Definition at line 229 of file Element.php.
|
protected |
Resolves the editable or non-editable template with data.
Definition at line 253 of file Element.php.
|
protected |
An input Id is typically formed like: modelClassName_attributeName or modelClassName_attributeName_relationAttributeName. This method resolves the input Id string.
string | $attributeName | |
string | $relationAttributeName |
Definition at line 277 of file Element.php.
|
protected |
An input name is typically formed like: modelClassName[attributeName] or modelClassName[attributeName][relationAttributeName]. This method resolves the input name string. Also handles scenarios where attributeName has something like abc[def]. This method will properly account for that.
string | $attributeName | |
string | $relationAttributeName |
Definition at line 303 of file Element.php.
|
static |
string | $attributeName |
Definition at line 325 of file Element.php.
|
protected |
An input Id or name is typically constructed like: modelClassName[attributeName]. The 'modelClassName' is considered the prefix of the input. Any inputPrefix specified in the parameters coming into the element will be used, otherwise the model class name will be utilized.
Definition at line 340 of file Element.php.