Class html_select

Description

Builder for HTML drop-down menus

Syntax:

 // create instance. arguments are used to set attributes of select-tag
 $select = new html_select(array('name' => 'fieldname'));

 // add one option
 $select->add('Switzerland', 'CH');

 // add multiple options
 $select->add(array('Switzerland','Germany'), array('CH','DE'));

 // generate pulldown with selection 'Switzerland'  and return html-code
 // as second argument the same attributes available to instanciate can be used
 print $select->show('CH');

Located in /lib/Roundcube/html.php (line 595)

html
   |
   --html_select
Variable Summary
 mixed $allowed
 mixed $options
 mixed $tagname
Method Summary
 void add (mixed $names, [mixed $values = null])
 string show ([string $select = array()], [array $attrib = null])
Variables
mixed $allowed = array('name','size','tabindex','autocomplete',
'multiple','onchange','disabled','rel')
(line 599)
  • access: protected

Redefinition of:
html::$allowed
mixed $options = array() (line 598)
  • access: protected
mixed $tagname = 'select' (line 597)
  • access: protected

Redefinition of:
html::$tagname

Inherited Variables

Inherited from html

html::$attrib
html::$common_attrib
html::$containers
html::$content
html::$doctype
html::$lc_tags
Methods
add (line 608)

Add a new option to this drop-down

  • access: public
void add (mixed $names, [mixed $values = null])
  • mixed $names: Option name or array with option names
  • mixed $values: Option value or array with option values
show (line 627)

Get HTML code for this object

  • return: HTML output
  • access: public
string show ([string $select = array()], [array $attrib = null])
  • string $select: Value of the selection option
  • array $attrib: Additional attributes to override

Redefinition of:
html::show()
Return the tag code

Inherited Methods

Inherited From html

 html::__construct()
 html::a()
 html::attrib_string()
 html::br()
 html::div()
 html::doctype()
 html::iframe()
 html::img()
 html::label()
 html::p()
 html::parse_attrib_string()
 html::quote()
 html::script()
 html::show()
 html::span()
 html::tag()

Documentation generated on Fri, 03 May 2013 12:44:55 +0200 by phpDocumentor 1.4.4