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 12 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
phpDocumentor

mosHTML::idBox

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

Syntax

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

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

Examples

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 ); ?>
    </td>
    <td>
    <?php echo $row->title; ?>
    </td>
  </tr>
  <?php
  $k = 1 - $k;
}

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


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