API16

API16:JHtmlSelect/booleanlist

From Joomla! Documentation

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

Description

Generates a yes/no radio list.

[Edit Descripton]

Template:Description:JHtmlSelect/booleanlist

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);
}

[Edit See Also] Template:SeeAlso:JHtmlSelect/booleanlist

Examples

<CodeExamplesForm />