Re: Re: Structures_DataGrid HTML_Template_Flexy renderer

From: Date: Tue, 07 Jun 2005 13:51:58 +0000
Subject: Re: Re: Structures_DataGrid HTML_Template_Flexy renderer
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19501@lists.php.net to get a copy of this message
On 07/06/2005, at 6:24 PM, Mark Wiesemann wrote:
My suggestion: Add something like the following to your renderer:
    function setFlexy(&$flexy)
    {
        $this->_flexy = &$flexy;
    }
Then construct the flexy object in your script (the script that uses SDG) and pass this object to SDG like this: $dg->renderer->setFlexy($flexy);
Mark its already there $dg->renderer->setFlexyObj($this->tpl);
If you add a variable "statistics" to your template, then you could use $statistics = 'page ' . $dg->getCurrentPage() . ' from ' . $dg->getPageCount() . ', record ' . $dg->getCurrentRecordNumberStart() .. ' to ' . $dg->getCurrentRecordNumberEnd() . ' from ' . $dg->getRecordCount(); for this new template variable.
It would still need to be in the renderer right ? I cant see why the function couldnt be there, considering its a renderer and a datagrid, and most of the datagrids i use require paging :)
If you want to use your setTemplate() function in the renderer class, then add a getFlexyObject() function to it which does only the following: return $this->_flexy; Or, even better: Write a getFlexy() function that is used by render(). Both will return the flexy object that you can use then the way I described above. (Look into the Smarty renderer - it's done there like this.)
You've lost me here :|

« previous php.pear.general (#19501) next »