Class CFormElement
CFormElement is the base class for presenting all kinds of form element.
CFormElement implements the way to get and set arbitrary attributes.
-
CComponent
-
CFormElement
Methods summary
abstract public
string
|
#
render( )
Renders this element.
Returns
string the rendering result
|
public
|
#
__construct( mixed $config, mixed $parent )
Constructor.
Parameters
- $config
mixed $config the configuration for this element.
- $parent
mixed $parent the direct parent of this element.
See
|
public
string
|
#
__toString( )
Converts the object to a string. This is a PHP magic method. The default
implementation simply calls CFormElement::render() and return the rendering result.
Converts the object to a string. This is a PHP magic method. The default
implementation simply calls CFormElement::render() and return the rendering result.
Returns
string the string representation of this object.
|
public
mixed
|
#
__get( string $name )
Returns a property value or an attribute value. Do not call this method. This
is a PHP magic method that we override to allow using the following syntax to
read a property or attribute:
$value=$element->propertyName;
$value=$element->attributeName;
Returns a property value or an attribute value. Do not call this method. This
is a PHP magic method that we override to allow using the following syntax to
read a property or attribute:
$value=$element->propertyName;
$value=$element->attributeName;
Parameters
- $name
string $name the property or attribute name
Returns
mixed the property or attribute value
Throws
CException
if the property or attribute is not defined
See
Overrides
|
public
boolean
|
#
__isset( string $name )
Checks a property value or an attribute value on existence or not null Do not
call this method. This is a PHP magic method that we override to allow using the
following syntax to read a property or attribute:
isset($element->propertyName);
Checks a property value or an attribute value on existence or not null Do not
call this method. This is a PHP magic method that we override to allow using the
following syntax to read a property or attribute:
isset($element->propertyName);
Parameters
- $name
string $name the property or attribute name
Returns
boolean
Overrides
|
public
mixed
|
#
__set( string $name, mixed $value )
Sets value of a property or attribute. Do not call this method. This is a PHP
magic method that we override to allow using the following syntax to set a
property or attribute.
$this->propertyName=$value;
$this->attributeName=$value;
Sets value of a property or attribute. Do not call this method. This is a PHP
magic method that we override to allow using the following syntax to set a
property or attribute.
$this->propertyName=$value;
$this->attributeName=$value;
Parameters
- $name
string $name the property or attribute name
- $value
mixed $value the property or attribute value
Returns
mixed
Throws
CException
if the property/event is not defined or the property is read only.
See
Overrides
|
public
|
#
configure( mixed $config )
Configures this object with property initial values.
Configures this object with property initial values.
Parameters
- $config
mixed $config the configuration for this object. This can be an array representing the
property names and their initial values. It can also be a string representing
the file name of the PHP script that returns a configuration array.
|
public
boolean
|
#
getVisible( )
Returns a value indicating whether this element is visible and should be
rendered. This method will call CFormElement::evaluateVisible() to determine the
visibility of this element.
Returns a value indicating whether this element is visible and should be
rendered. This method will call CFormElement::evaluateVisible() to determine the
visibility of this element.
Returns
boolean whether this element is visible and should be rendered.
|
public
|
#
setVisible( boolean $value )
Parameters
- $value
boolean $value whether this element is visible and should be rendered.
|
public
mixed
|
#
getParent( )
Returns
mixed the direct parent of this element. This could be either a CForm object
or a CBaseController object (a controller or a widget).
|
protected
boolean
|
#
evaluateVisible( )
Evaluates the visibility of this element. Child classes should override this
method to implement the actual algorithm for determining the visibility.
Evaluates the visibility of this element. Child classes should override this
method to implement the actual algorithm for determining the visibility.
Returns
boolean whether this element is visible. Defaults to true.
|
Methods inherited from CComponent
__call(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
Properties summary
public
array
|
$attributes
|
array() |
#
list of attributes (name=>value) for the HTML element represented by this
object.
list of attributes (name=>value) for the HTML element represented by this
object.
|
Magic properties summary
public
boolean
|
$visible
|
#
Whether this element is visible and should be rendered.
Whether this element is visible and should be rendered.
|
public
mixed
|
$parent
|
#
The direct parent of this element. This could be either a CForm
object or a CBaseController object (a controller or a widget).
The direct parent of this element. This could be either a CForm
object or a CBaseController object (a controller or a widget).
|