1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 8 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Developer Manual arrow 11. API Reference arrow mosHTML::integerSelectList

mosHTML::integerSelectList PDF Print E-mail

Last reviewed: Not reviewed
phpDocumentor

mosHTML::integerSelectList

This method builds a list of numbers from $start to $end with an increment of $inc. The optional $format argument allows you to apply a printf sytle format to the numbers.

Syntax

string integerSelectList ( int $start, int $end, int $inc, string $tag_name,
                                              string $tag_attribs, mixed $selected [, string $format] )

$start
is the first number on the select list.
$end
is the last number on the select list.
$inc
is the increment between successive numbers on the list.
$tag_name
is the name attribute of the HTML <select> tag.
$tag_attribs
is a string containing any additional attributes that you want to assign to the <select> tag.
$selected
is either a string value for a single value select list or an array for a multiple value select list.
$format
is a printf style format string to be applied to each number in the list.

Examples

Example:
$html = mosHTML::integerSelectList( -12, 12, 1, 'tzoffset', 'size="1" class="inputbox"', 0, "%02d" );
echo $html;

which produces:

<select name="tzoffset" size="1" class="inputbox">
  <option value="-12">-12</option>
  <option value="-11">-11</option>
  <option value="-10">-10</option>
 
  <option value="-9">-9</option>
  <option value="-8">-8</option>
  <option value="-7">-7</option>
  <option value="-6">-6</option>
  <option value="-5">-5</option>
  <option value="-4">-4</option>
 
  <option value="-3">-3</option>
  <option value="-2">-2</option>
  <option value="-1">-1</option>
  <option value="00" selected="selected">00</option>
  <option value="01">01</option>
  <option value="02">02</option>
 
  <option value="03">03</option>
  <option value="04">04</option>
  <option value="05">05</option>
  <option value="06">06</option>
  <option value="07">07</option>
  <option value="08">08</option>
 
  <option value="09">09</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
</select>
 

which renders as:



Please report any errors on this page to the Developer Documentation Forum.


Last Updated ( Saturday, 03 September 2005 )
 
< Prev   Next >