Re: Re: Structures_DataGrid HTML_Template_Flexy renderer
| From: | Mark Wiesemann | Date: | Tue, 07 Jun 2005 16:05:53 +0000 |
| Subject: | Re: Re: Structures_DataGrid HTML_Template_Flexy renderer | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19502@lists.php.net to get a copy of this message | ||
Dan Rossi wrote:
> Mark its already there
>
> $dg->renderer->setFlexyObj($this->tpl);
Okay, perfect. I have overlooked it because of the tab/spaces problem.
> It would still need to be in the renderer right ?
No, not in the renderer. Do it better in the function data_grid().
> 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 :)
I _can_ in be the renderer class, no problem. But:
- the statistical functions are in Core.php (=> they can be used with
each renderer, they don't exist more than once)
- not everybody want's to show the page number, the numbers of pages
etc. the same way you do it (altough it's flexbile because of using
templates, one is even more flexible by not having this directly in the
renderer class)
Maybe Andrew told you also something like this? Or how did you mean "I
have been advised"?
>> 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 :|
Hmm, describing this more detail would require much typing. What I meant
was, in short: you can do it the way how Smarty and HTMLTable renderer
do it: Having a render() function that calls getSmarty() or toHTML() and
return the results of them. This way render() renders the DataGrid
directly and getSmarty() returns the template object / toHTML returns
the HTML code instead of outputting it.
But the way it is, is also fine, as one can pass the template (flexy)
object to SDG.
Mark