Support Joomla!

references:joomla.legacy:1.5:moshtml-idbox

Table of Contents

idBox

API Package Class phpDocumentor Last reviewed Doc status
Joomla.Legacy 1.5 mosHTML mosHTML->idBox never Work in progress

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 integer is the index number of the HTML table row.
$record_id integer is the database Record index number.
$enable boolean 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 string 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.

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;
}
 
references/joomla.legacy/1.5/moshtml-idbox.txt (3295 views) · Last modified: 2007/09/22 02:45