Actions

API17

Difference between revisions of "JHtmlSelect::option"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 8: Line 8:
 
<nowiki>[</nowiki>[[Description:JHtmlSelect::option|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JHtmlSelect::option|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Synopsis===
 
 
<source lang="php">
 
<source lang="php">
public static JHtmlSelect::option ($value, $text= '', $optKey= 'value', $optText= 'text', $disable=false)
+
public static function option (
 +
        $value
 +
        $text= ''
 +
        $optKey= 'value'
 +
        $optText= 'text'
 +
        $disable=false
 +
)
 
</source>
 
</source>
 
{| class="wikitable"
 
{| class="wikitable"
Line 32: Line 37:
 
|string|array
 
|string|array
 
|'value'
 
|'value'
|If a string, the returned object property name for the value. If an array, options. Valid options are:  
+
|If a string, the returned object property name for the value. If an array, options. Valid options are: attr: String|array. Additional attributes for this option. Defaults to none. disable: Boolean. If set, this option is disabled. label: String. The value for the option label. option.attr: The property in each option array to use for additional selection attributes. Defaults to none. option.disable: The property that will hold the disabled state. Defaults to "disable". option.key: The property that will hold the selection value. Defaults to "value". option.label: The property in each option array to use as the selection label attribute. If a "label" option is provided, defaults to "label", if no label is given, defaults to null (none). option.text: The property that will hold the the displayed text. Defaults to "text". If set to null, the option array is assumed to be a list of displayable scalars.
 
+
 
|-
 
|-
 
|$optText
 
|$optText
 
|string
 
|string
 
|'text'
 
|'text'
|The property that will hold the the displayed text. This parameter is ignored if an options array is passed.  
+
|The property that will hold the the displayed text. This parameter is ignored if an options array is passed.
 
|-
 
|-
 
|$disable
 
|$disable
Line 46: Line 50:
 
|-
 
|-
 
|}
 
|}
===Returns===
+
* '''Returns''' object
object
+
* '''Defined''' on line 400 of libraries/joomla/html/html/select.php
===Defined in===
+
libraries/joomla/html/html/select.php (line 396)
+
* see source code in [[jplatform:html/html/select.php#cl-396|BitBucket]]
+
===Referenced by===
+
 
===See also===
 
===See also===
 +
* {{JVer|11.1}} '''JHtmlSelect::option source code''' on [[jplatform:html/html/select.php#cl-392|BitBucket]]
 +
* {{JVer|11.1}} Class [[JHtmlSelect/11.1|JHtmlSelect]]
 +
* {{JVer|11.1}} Subpackage [[Subpackage_Html/11.1|Html]]
 +
* [[JHtmlSelect::option|Other versions of JHtmlSelect::option]]
 +
{{SeeAlso:JHtmlSelect::option}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JHtmlSelect::option|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JHtmlSelect::option|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
* [[JHtmlSelect/11.1|JHtmlSelect]]
+
===User contributed notes===
* [[JHtmlSelect::option|Other versions of this method]]
+
{{SeeAlso:JHtmlSelect::option}}
+
===Examples===
+
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 67: Line 69:
 
category=MethodExample
 
category=MethodExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:JHtmlSelect]][[Category:JHtmlSelect::option]]</noinclude>
 
<noinclude>[[Category:JHtmlSelect]][[Category:JHtmlSelect::option]]</noinclude>

Revision as of 21:08, 27 April 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Joomla 11.1 JHtmlSelect::option

Description

Create an object that represents an option in an option list.

Description:JHtmlSelect::option [Edit Descripton]

public static function option (
        $value
        $text= ''
        $optKey= 'value'
        $optText= 'text'
        $disable=false
)
Parameter Type Default Description
$value string The value of the option
$text string The text for the option
$optKey array 'value' array. Additional attributes for this option. Defaults to none. disable: Boolean. If set, this option is disabled. label: String. The value for the option label. option.attr: The property in each option array to use for additional selection attributes. Defaults to none. option.disable: The property that will hold the disabled state. Defaults to "disable". option.key: The property that will hold the selection value. Defaults to "value". option.label: The property in each option array to use as the selection label attribute. If a "label" option is provided, defaults to "label", if no label is given, defaults to null (none). option.text: The property that will hold the the displayed text. Defaults to "text". If set to null, the option array is assumed to be a list of displayable scalars.
$optText string 'text' The property that will hold the the displayed text. This parameter is ignored if an options array is passed.
$disable false
  • Returns object
  • Defined on line 400 of libraries/joomla/html/html/select.php

See also

SeeAlso:JHtmlSelect::option [Edit See Also]

User contributed notes

<CodeExamplesForm />