Actions

API15

JHTMLSelect/booleanlist

From Joomla! Documentation

< API15:JHTMLSelect
Revision as of 13:30, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Contents

Description

Generates a yes/no radio list

[<! removed edit link to red link >]

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

Syntax

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

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 />