For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2005 > Re: [PEAR] Re: Structures_DataGrid HTML_Template_Flexy renderer









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Re: Structures_DataGrid HTML_Template_Flexy renderer
Dan Rossi

2005-06-07, 4:00 pm


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 :|
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com