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

Class: HTML_Select

Source Location: /HTML_Select-1.3.1/HTML/Select.php

Class Overview

HTML_Common
   |
   --HTML_Select

Class to dynamically create an HTML SELECT


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 28]
Class to dynamically create an HTML SELECT


[ Top ]


Method Detail

HTML_Select (Constructor)   [line 63]

HTML_Select HTML_Select( [string $name = ''], [integer $size = 1], [boolean $multiple = false], [mixed $attributes = null], [integer $tabOffset = 0])

Class constructor
  • Since: 1.0
  • Access: public

Parameters:

string   $name   —  Name attribute of the SELECT
integer   $size   —  Size attribute of the SELECT
boolean   $multiple   —  Whether the select will allow multiple selections or not
mixed   $attributes   —  Either a typical HTML attribute string or an associative array
integer   $tabOffset   —  Number of tabs to offset HTML source

[ Top ]

addOption   [line 143]

void addOption( string $text, string $value, [boolean $selected = false], [mixed $attributes = null])

Adds a new OPTION to the SELECT

Parameters:

string   $text   —  Display text for the OPTION
string   $value   —  Value for the OPTION
boolean   $selected   —  Whether the option is selected or not
mixed   $attributes   —  Either a typical HTML attribute string or an associative array

[ Top ]

addStartOptionGroup   [line 167]

void addStartOptionGroup( string $text, [array $attributes = null])

Starts an option group "<optgroup>"
  • See: addOptionGroup()
  • Since: 1.3.0
  • Access: public

Parameters:

string   $text   —  Label
array   $attributes   —  HTML attribute associative array

[ Top ]

addStopOptionGroup   [line 187]

void addStopOptionGroup( )

Stops an option group "</optgroup>"

[ Top ]

apiVersion   [line 90]

double apiVersion( )

Returns the current API version
  • Since: 1.0
  • Access: public

[ Top ]

getSelectedValues   [line 122]

array getSelectedValues( )

Returns an array of the selected values
  • Return: of selected values
  • Since: 1.0
  • Access: public

[ Top ]

load   [line 373]

PEAR_Error load( mixed &$options, [mixed $param1 = null], [mixed $param2 = null], [mixed $param3 = null], [mixed $param4 = null])

Loads options from different types of data sources

This method is a simulated overloaded method. The arguments, other than the first are optional and only mean something depending on the type of the first argument. If the first argument is an array then all arguments are passed in order to loadArray. If the first argument is a db_result then all arguments are passed in order to loadDbResult. If the first argument is a string or a DB connection then all arguments are passed in order to loadQuery.

  • Return: on error or true, or false if no method to load the data could be determined.
  • Since: 1.1
  • Throws: PEAR_Error
  • Access: public

Parameters:

mixed   &$options   —  Options source currently supports assoc array or DB_result
mixed   $param1   —  See function detail
mixed   $param2   —  See function detail
mixed   $param3   —  See function detail
mixed   $param4   —  See function detail

[ Top ]

loadArray   [line 205]

PEAR_Error loadArray( array $arr, [mixed $values = null])

Loads the options from an associative array
  • Return: on error or true
  • Since: 1.0
  • Throws: PEAR_Error
  • Access: public

Parameters:

array   $arr   —  Associative array of options
mixed   $values   —  Array or comma delimited string of selected values

[ Top ]

loadDbResult   [line 282]

PEAR_Error loadDbResult( object &$result, [string $textCol = null], [string $valueCol = null], [mixed $values = null])

Loads the options from DB_result object

If no column names are specified the first two columns of the result are used as the text and value columns respectively

  • Return: on error or true
  • Since: 1.0
  • Throws: PEAR_Error
  • Access: public

Parameters:

object   &$result   —  DB_result object
string   $textCol   —  Name of column to display as the OPTION text
string   $valueCol   —  Name of column to use as the OPTION value
mixed   $values   —  Array or comma delimited string of selected values

[ Top ]

loadValueArray   [line 241]

PEAR_Error loadValueArray( array $arr, [mixed $values = null])

Loads the options from an array with numeric keys, using the array values as the form values as well as labels.
  • Return: on error or true
  • Since: 1.2
  • Throws: PEAR_Error
  • Access: public

Parameters:

array   $arr   —  Array of options
mixed   $values   —  Array or comma delimited string of selected values

[ Top ]

setSelectedValues   [line 104]

void setSelectedValues( mixed $values)

Sets the default values of the select box
  • Since: 1.0
  • Access: public

Parameters:

mixed   $values   —  Array or comma delimited string of selected values

[ Top ]

toHtml   [line 397]

string toHtml( )

Returns the SELECT in HTML
  • Return: HTML code
  • Since: 1.0
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:47:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.