cvs: pear /Structures_DataGrid/DataGrid/Renderer Smarty.php

From: Date: Tue, 18 Jan 2005 19:45:41 +0000
Subject: cvs: pear /Structures_DataGrid/DataGrid/Renderer Smarty.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-28667@lists.php.net to get a copy of this message
asnagy Tue Jan 18 14:45:41 2005 EDT Modified files: /pear/Structures_DataGrid/DataGrid/Renderer Smarty.php Log: Added a getSmarty method to allow for more controll of the smarty object http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php?r1=1.9&r2=1.10&ty=u Index: pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php diff -u pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php:1.9 pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php:1.10 --- pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php:1.9 Tue Jan 18 14:31:23 2005 +++ pear/Structures_DataGrid/DataGrid/Renderer/Smarty.php Tue Jan 18 14:45:41 2005 @@ -16,14 +16,14 @@ // | Author: Andrew Nagy <asnagy@webitecture.org> | // +----------------------------------------------------------------------+ // -// $Id: Smarty.php,v 1.9 2005/01/18 19:31:23 asnagy Exp $ +// $Id: Smarty.php,v 1.10 2005/01/18 19:45:41 asnagy Exp $ require_once 'Smarty/Smarty.class.php'; /** * Structures_DataGrid_Renderer_Smarty Class * - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * @author Andrew S. Nagy <asnagy@webitecture.org> * @access public * @package Structures_DataGrid @@ -69,30 +69,38 @@ } } - function render() + function getSmarty() { - $dg =& $this->_dg; - // Get the data to be rendered - $dg->fetchDataSource(); + $this->_dg->fetchDataSource(); // Check to see if column headers exist, if not create them // This must follow after any fetch method call - $dg->_setDefaultHeaders(); + $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('pageList', $this->_dg->pageList); $this->_smarty->assign('currentPage', $this->_dg->page); - $this->_smarty->display($this->_tpl); + return $smarty; } else { return new PEAR_Error('Error: No template defined'); } } + + function render() + { + $smarty = $this->getSmarty(); + + if (PEAR::isError($smarty)) { + return $smarty; + } else { + $smarty->display($this->_tpl); + } + } } -?> +?> \ No newline at end of file

« previous php.pear.cvs (#28667) next »