Structures_DataGrid::bindDataSource() -- Binds a Structures_DataGrid_DataSource object to the DataGrid.
ðÁÒÁÍÅÔÒ
- Structures_DataGrid_DataSource
$source
The DataSource object
÷ÏÚ×ÒÁÝÁÅÍÏÅ ÚÎÁÞÅÎÉÅ
mixed - TRUE upon success otherwise a PEAR_Error upon failure
ðÒÉÍÅÒ
Пример 53-1. Bind datagrid to a DB_Result Object <?php
require('Structures/DataGrid.php');
$dg =& new Structures_DataGrid();
// Get my data
$result = $db->query('SELECT * FROM users');
// Bind to DataGrid
$data = Structures_DataGrid_DataSource::create($result);
$dg->bindDataSource($data);
// Print the DataGrid
$dg->render();
?> |
|