Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CForm
  • CFormButtonElement
  • CFormElement
  • CFormElementCollection
  • CFormInputElement
  • CFormStringElement
  • Overview
  • Package
  • Class
  • Tree

Class CFormElementCollection

CFormElementCollection implements the collection for storing form elements.

Because CFormElementCollection extends from CMap, it can be used like an associative array. For example,

$element=$collection['username'];
$collection['username']=array('type'=>'text', 'maxlength'=>128);
$collection['password']=new CFormInputElement(array('type'=>'password'),$form);
$collection[]='some string';

CFormElementCollection can store three types of value: a configuration array, a CFormElement object, or a string, as shown in the above example. Internally, these values will be converted to CFormElement objects.

CComponent
Extended by CMap implements IteratorAggregate, ArrayAccess, Countable
Extended by CFormElementCollection
Package: system\web\form
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/CFormElementCollection.php
Methods summary
public
# __construct( CForm $form, boolean $forButtons = false )

Constructor.

Constructor.

Parameters

$form
CForm
$form the form object that owns this collection
$forButtons
boolean
$forButtons whether this collection is used to store buttons.

Throws

CException
If data is not null and neither an array nor an iterator.

Overrides

CMap::__construct()
public
# add( mixed $key, mixed $value )

Adds an item to the collection. This method overrides the parent implementation to ensure only configuration arrays, strings, or CFormElement objects can be stored in this collection.

Adds an item to the collection. This method overrides the parent implementation to ensure only configuration arrays, strings, or CFormElement objects can be stored in this collection.

Parameters

$key
mixed
$key key
$value
mixed
$value value

Throws

CException
if the value is invalid.

Overrides

CMap::add()
public mixed
# remove( string $key )

Removes the specified element by key.

Removes the specified element by key.

Parameters

$key
string
$key the name of the element to be removed from the collection

Returns

mixed
the removed value, null if no such key exists.

Throws

CException
if the map is read-only

Overrides

CMap::remove()
Methods inherited from CMap
clear(), contains(), copyFrom(), count(), getCount(), getIterator(), getKeys(), getReadOnly(), itemAt(), mergeArray(), mergeWith(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), setReadOnly(), toArray()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Magic properties inherited from CMap
$count, $iterator, $keys, $readOnly
API documentation generated by ApiGen 2.8.0