PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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');
}
}