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 preparing for archive only
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
Generates a yes/no radio list.
Generates a yes/no radio list.


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


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


===Syntax===
===Syntax===
Line 63: Line 61:
</source>
</source>


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


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=booleanlist
  category=booleanlist
  category=JHtmlSelect
  category=JHtmlSelect
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Latest revision as of 01:47, 25 March 2017

Description

Generates a yes/no radio list.


<! 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 transcluded page call, red link never existed >

Examples

Code Examples