Builder for HTML drop-down menus Syntax:<pre> // 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');
| package |
Framework |
|---|---|
| subpackage |
View |
__construct(array $attrib = array())
arrayHash array with tag attributes
a(mixed $attr, string $cont) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with link location (href)
stringLink content
stringHTML code
add(mixed $names, mixed $values = null, array $attrib = array())
mixedOption name or array with option names
mixedOption value or array with option values
arrayAdditional attributes for the option entry
attrib_string(array $attrib = array(), array $allowed = null) : string
arrayAssociative array with tag attributes
arrayList of allowed attributes
stringValid attribute string
br(array $attrib = array()) : string
| see | \html::tag() |
|---|
arrayAssociative arry with tag attributes
stringHTML code
div(mixed $attr = null, string $cont = null) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with class name
stringDiv content
stringHTML code
doctype(string $type)
stringDocument type (html5, xhtml, 'xhtml-trans, xhtml-strict)
iframe(mixed $attr = null, $cont = null) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with frame source (src)
stringHTML code
img(mixed $attr = null) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with image source (src)
stringHTML code
label(mixed $attr, string $cont) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with 'for' attrib
stringTag content
stringHTML code
p(mixed $attr = null, string $cont = null) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with class name
stringParagraph content
stringHTML code
parse_attrib_string( $str) : array
arrayKey-value pairs of parsed attributes
quote(string $str) : string
stringInput string
stringThe quoted string
script(mixed $attr, string $cont = null) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with script source (src)
stringJavascript code to be placed as tag content
stringHTML code
show() : string
stringThe finally composed HTML tag
span(mixed $attr, string $cont) : string
| see | \html::tag() |
|---|
mixedHash array with tag attributes or string with class name
stringTag content
stringHTML code
tag(string $tagname, array $attrib = array(), string $content = null, array $allowed = null) : string
stringTag name
arrayTag attributes as key/value pairs
stringOptinal Tag content (creates a container tag)
arrayList with allowed attributes, omit to allow all
stringThe XHTML tag
tagname :
allowed :
content :
attrib :
doctype :
common_attrib :
containers :
bool_attrib :