Re: Structures_DataGrid_Renderer_Smarty
| From: | Mark Wiesemann | Date: | Thu, 19 Oct 2006 07:59:10 +0000 |
| Subject: | Re: Structures_DataGrid_Renderer_Smarty | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25548@lists.php.net to get a copy of this message | ||
Chris Boget wrote:
> Is there an example out there illustrating how to utilize this renderer?
> I've searched on Google and came up short. Unfortunately, the documentation
> is minimal and the only code example given is for the template. What about
> the rest of it? How do you set up the interaction between Smarty and
> DataGrid?
Hmm, there's really something missing. I've added that on my TODO list
and I'll update the manual soon.
What you need to do is something like the following:
$s = new Smarty(...);
$dg =& new Structures_DataGrid(...);
$dg->bind(...);
$dg->fill($s);
$s->display(PATH TO YOUR TEMPLATE);
> Also, the docs say that the Smarty driver does not support the render()
> method and that it's up to the developer to call Smarty's display() method.
> In light of that, what, really, is the Smarty DG driver actually doing?
It gives you the "contents" for the template, i.e. both attributes and
contents for the cells. It may sound trivial, but have a look at the
code: there are more than a few lines.
Regards,
Mark