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

Class: HTML_QuickForm2_Element_Select_OptionContainer

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

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Element_Select_OptionContainer

Collection of <option>s and <optgroup>s


Author(s):

Version:

  • Release: 2.1.0

Variables

Methods


Child classes:

HTML_QuickForm2_Element_Select_Optgroup
Class representing an <optgroup> tag

Inherited Variables

Inherited Methods


Class Details

[line 42]
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 53]

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 65]

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

Type:   array


[ Top ]

$values =

[line 59]

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

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 74]

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 121]

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 91]

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 191]

int count( )

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

[ Top ]

getIterator   [line 168]

HTML_QuickForm2_Element_Select_OptionIterator getIterator( )

Returns an iterator over contained elements
  • Access: public

[ Top ]

getOptions   [line 135]

array getOptions( )

Returns an array of contained options
  • Access: public

[ Top ]

getRecursiveIterator   [line 178]

RecursiveIteratorIterator getRecursiveIterator( )

Returns a recursive iterator over contained elements
  • Access: public

[ Top ]

__toString   [line 140]

void __toString( )

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Element_Select_Optgroup::__toString()

[ Top ]


Documentation generated on Wed, 10 Apr 2019 08:56:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.