API16

JHtmlSelect/booleanlist: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Generates a yes/no radio list. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHtmlSelect/booleanlist|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JHtmlSelect/booleanlist}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 64: Line 64:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JHtmlSelect/booleanlist|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JHtmlSelect/booleanlist}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 79: Line 79:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Revision as of 02:58, 14 May 2013

Description

Generates a yes/no radio list.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static booleanlist($name, $attribs=null, $selected=null, $yes= 'yes', $no= 'no', $id=false)
Parameter Name Default Value Description
$name The value of the HTML name attribute
$attribs null Additional HTML attributes for the <select> tag
$selected null The key that is selected
$yes 'yes'
$no 'no'
$id false

Returns

string HTML for the radio list

Defined in

libraries/joomla/html/html/select.php

Importing

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

Source Body

public static function booleanlist(
        $name, $attribs = null, $selected = null, $yes = 'yes', $no = 'no', $id = false
) {
        $arr = array(
                JHtml::_('select.option', '0', JText::_($no)),
                JHtml::_('select.option', '1', JText::_($yes))
        );
        return JHtml::_('select.radiolist', $arr, $name, $attribs, 'value', 'text', (int) $selected, $id);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />