CFormElement
Package | system.web.form |
---|---|
Inheritance | abstract class CFormElement » CComponent |
Subclasses | CForm, CFormButtonElement, CFormInputElement, CFormStringElement |
Since | 1.1 |
Version | $Id: CFormElement.php 1820 2010-02-19 03:03:01Z qiang.xue $ |
CFormElement implements the way to get and set arbitrary attributes.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
attributes | array | list of attributes (name=>value) for the HTML element represented by this object. | CFormElement |
parent | mixed | the direct parent of this element. | CFormElement |
visible | boolean | Returns a value indicating whether this element is visible and should be rendered. | CFormElement |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | CComponent |
__construct() | Constructor. | CFormElement |
__get() | Returns a property value or an attribute value. | CFormElement |
__isset() | Checks if a property value is null. | CComponent |
__set() | Sets value of a property or attribute. | CFormElement |
__toString() | Converts the object to a string. | CFormElement |
__unset() | Sets a component property to be null. | CComponent |
asa() | Returns the named behavior object. | CComponent |
attachBehavior() | Attaches a behavior to this component. | CComponent |
attachBehaviors() | Attaches a list of behaviors to the component. | CComponent |
attachEventHandler() | Attaches an event handler to an event. | CComponent |
canGetProperty() | Determines whether a property can be read. | CComponent |
canSetProperty() | Determines whether a property can be set. | CComponent |
configure() | Configures this object with property initial values. | CFormElement |
detachBehavior() | Detaches a behavior from the component. | CComponent |
detachBehaviors() | Detaches all behaviors from the component. | CComponent |
detachEventHandler() | Detaches an existing event handler. | CComponent |
disableBehavior() | Disables an attached behavior. | CComponent |
disableBehaviors() | Disables all behaviors attached to this component. | CComponent |
enableBehavior() | Enables an attached behavior. | CComponent |
enableBehaviors() | Enables all behaviors attached to this component. | CComponent |
evaluateExpression() | Evaluates a PHP expression or callback under the context of this component. | CComponent |
getEventHandlers() | Returns the list of attached event handlers for an event. | CComponent |
getParent() | CFormElement | |
getVisible() | Returns a value indicating whether this element is visible and should be rendered. | CFormElement |
hasEvent() | Determines whether an event is defined. | CComponent |
hasEventHandler() | Checks whether the named event has attached handlers. | CComponent |
hasProperty() | Determines whether a property is defined. | CComponent |
raiseEvent() | Raises an event. | CComponent |
render() | Renders this element. | CFormElement |
setVisible() | CFormElement |
Protected Methods
Method | Description | Defined By |
---|---|---|
evaluateVisible() | Evaluates the visibility of this element. | CFormElement |
Property Details
list of attributes (name=>value) for the HTML element represented by this object.
the direct parent of this element. This could be either a CForm object or a CBaseController object (a controller or a widget).
Returns a value indicating whether this element is visible and should be rendered. This method will call evaluateVisible to determine the visibility of this element.
Method Details
public void __construct(mixed $config, mixed $parent)
| ||
$config | mixed | the configuration for this element. |
$parent | mixed | the direct parent of this element. |
Constructor.
See Also
public mixed __get(string $name)
| ||
$name | string | the property or attribute name |
{return} | mixed | the property or attribute value |
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;
See Also
public void __set(string $name, mixed $value)
| ||
$name | string | the property or attribute name |
$value | mixed | the property or attribute 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;
See Also
public string __toString()
| ||
{return} | string | the string representation of this object. |
Converts the object to a string. This is a PHP magic method. The default implementation simply calls render and return the rendering result.
public void configure(mixed $config)
| ||
$config | mixed | 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. |
Configures this object with property initial values.
protected boolean evaluateVisible()
| ||
{return} | boolean | whether this element is visible. Defaults to true. |
Evaluates the visibility of this element. Child classes should override this method to implement the actual algorithm for determining the visibility.
public mixed getParent()
| ||
{return} | mixed | the direct parent of this element. This could be either a CForm object or a CBaseController object (a controller or a widget). |
public boolean getVisible()
| ||
{return} | boolean | whether this element is visible and should be rendered. |
Returns a value indicating whether this element is visible and should be rendered. This method will call evaluateVisible to determine the visibility of this element.
abstract public string render()
| ||
{return} | string | the rendering result |
Renders this element.
public void setVisible(boolean $value)
| ||
$value | boolean | whether this element is visible and should be rendered. |