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 13 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::idBox

mosHTML::idBox PDF Print E-mail

Last reviewed: Not reviewed


Builds the HTML code for a standard selectable checkbox for use on a database list-select screen.


string idBox ( integer $row_index, integer $record_id [, boolean $enable [, string $name ]] )

is the index number of the HTML table row.
is the database record index number.
is a flag.  If false then the method will return an empty string.  This parameter is optional and if omitted will default to false.
is name of the HTML form field.  This parameter is optional and if omitted will default to 'cid'.


Example: Display a list of records from a database query with standard selection checkboxes.  Note that in this example the table row class is alternated between "row0" and "row1" so as to get the striped effect.  Only the id and title fields are shown in this example.
// $rows returned from a database query.
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
  $row = $rows[$i];
  <tr class="<?php echo "row$k"; ?>">
    <td width="20">
    <?php echo mosHTML::idBox( $i, $row->id ); ?>
    <?php echo $row->title; ?>
  $k = 1 - $k;

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

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