Home » Structures » Structures_DataGrid » Bug #6670
renderer_smarty can't display template (fix!)
Details
| Submitted | 2006-02-02 14:11 UTC |
|---|---|
| From | nick at tesbo dot com |
| Assigned | wiesemann |
| Status | Closed |
| Package | Structures_DataGrid |
| PHP Version | 5.1.1 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2006-02-02 14:11 UTC] nick at tesbo dot com
Description:
------------
the smarty renderer doesn't work due to a bug in getSmarty(): it returns a non-existent object $smarty. here's the fix:
function getSmarty()
{
/*
// Get the data to be rendered
$this->_dg->fetchDataSource();
*/
// Check to see if column headers exist, if not create them
// This must follow after any fetch method call
$this->_dg->_setDefaultHeaders();
if ($this->_tpl != '') {
$this->_smarty->assign('recordSet', $this->_dg->recordSet);
$this->_smarty->assign('columnSet', $this->_dg->columnSet);
$this->_smarty->assign('recordLimit', $this->_dg->rowLimit);
$this->_smarty->assign('currentPage', $this->_dg->page);
return $this->_smarty; // this is the fix
} else {
return new PEAR_Error('Error: No template defined');
}
}