HTML_QuickForm2
[ class tree: HTML_QuickForm2 ] [ index: HTML_QuickForm2 ] [ all elements ]

Class: HTML_QuickForm2_Element_Select_OptionContainer

Source Location: /HTML_QuickForm2-2.0.0/HTML/QuickForm2/Element/Select.php

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Element_Select_OptionContainer

Collection of <option>s and <optgroup>s


Author(s):

Version:

  • Release: 2.0.0

Variables

Methods


Child classes:

HTML_QuickForm2_Element_Select_Optgroup
Class representing an <optgroup> tag

Inherited Variables

Inherited Methods


Class Details

[line 66]
Collection of <option>s and <optgroup>s

This class handles the output of <option> tags. The class is not intended to be used directly.



[ Top ]


Class Variables

$options = array()

[line 77]

List of options and optgroups in this container

Options are stored as arrays (for performance reasons), optgroups as instances of Optgroup class.

  • Access: protected

Type:   array


[ Top ]

$possibleValues =

[line 89]

Reference to parent <select>'s possible values
  • Access: protected

Type:   array


[ Top ]

$values =

[line 83]

Reference to parent <select>'s values
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 98]

HTML_QuickForm2_Element_Select_OptionContainer __construct( array &$values, array &$possibleValues)

Class constructor
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Element_Select_Optgroup::__construct()
Class constructor

Parameters:

array   &$values     Reference to values of parent <select> element
array   &$possibleValues     Reference to possible values of parent <select> element

[ Top ]

addOptgroup   [line 145]

HTML_QuickForm2_Element_Select_Optgroup addOptgroup( string $label, [string|array $attributes = null])

Adds a new optgroup
  • Access: public

Parameters:

string   $label     'label' attribute for optgroup tag
string|array   $attributes     Additional attributes for <optgroup> tag (either as a string or as an associative array)

[ Top ]

addOption   [line 115]

void addOption( string $text, string $value, [string|array $attributes = null])

Adds a new option

Please note that if you pass 'selected' attribute in the $attributes parameter then this option's value will be added to <select>'s values.

  • Access: public

Parameters:

string   $text     Option text
string   $value     'value' attribute for <option> tag
string|array   $attributes     Additional attributes for <option> tag (either as a string or as an associative array)

[ Top ]

count   [line 215]

int count( )

Returns the number of options in the container
  • Access: public

[ Top ]

getIterator   [line 192]

HTML_QuickForm2_Element_Select_OptionIterator getIterator( )

Returns an iterator over contained elements
  • Access: public

[ Top ]

getOptions   [line 159]

array getOptions( )

Returns an array of contained options
  • Access: public

[ Top ]

getRecursiveIterator   [line 202]

RecursiveIteratorIterator getRecursiveIterator( )

Returns a recursive iterator over contained elements
  • Access: public

[ Top ]

__toString   [line 164]

void __toString( )

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Element_Select_Optgroup::__toString()

[ Top ]


Documentation generated on Tue, 26 Jun 2012 15:30:29 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.