API15

API15:JHTMLSelect/optgroup

From Joomla! Documentation

Revision as of 22:21, 22 March 2010 by Doxiki (talk | contribs) (New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JHTMLSelect/optgrou...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

[Edit Descripton]

Template:Description:JHTMLSelect/optgroup

Syntax

optgroup($text, $value_name= 'value', $text_name= 'text')
Parameter Name Default Value Description
$text The text for the option
$value_name 'value' The returned object property name for the value
$text_name 'text' The returned object property name for the text

Returns

object

Defined in

libraries/joomla/html/html/select.php

Importing

jimport( 'joomla.html.html.select' );

Source Body

function optgroup( $text, $value_name = 'value', $text_name = 'text' )
{
        $obj = new stdClass;
        $obj->$value_name       = '<OPTGROUP>';
        $obj->$text_name        = $text;
        return $obj;
}

[Edit See Also] Template:SeeAlso:JHTMLSelect/optgroup

Examples

<CodeExamplesForm />