PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #6670

renderer_smarty can't display template (fix!)

Details

Submitted2006-02-02 14:11 UTC
Fromnick at tesbo dot com
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP Version5.1.1
OSlinux
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');
}
}