Re: Structures_DataGrid_Renderer questions
| From: | Justin Patrin | Date: | Sun, 02 Oct 2005 21:26:15 +0000 |
| Subject: | Re: Structures_DataGrid_Renderer questions | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21199@lists.php.net to get a copy of this message | ||
On 10/2/05, Prue <prue@clipmagic.com.au> wrote:
> Hi
>
> I have 2 questions:
>
> 1. After installing SDG in my php/PEAR dir, the examples worked fine.
> However I am developing an application that will be hosted so I want to have
> a PEAR directory inside the web root. I have created an .htaccess file with
> the new include path. It seems to be working fine for other PEAR packages.
> The problem arises when I use SDG.
>
> I have created a custom class which extends SDG. After getting the dataset
> (which I've confirmed) and the script gets to $db->render(); I get the
> following error:
>
> Fatal error: Call to a member function render() on a non-object in
> c:\wamp\www\aaa-myownproject\include\PEAR\Structures\DataGrid\Renderer.php
> on line 69
>
> The problem occurs regardless of the renderer chosen, eg default and/or xls.
>
Debug it. This is probably due to an inclusion error. Look into the
SDG code and find the @include call and remove the @. Then figure out
why that is happening.
> 2. I want to output to Smarty but am not sure what I need to put in the
> template to tell SDG where to output the grid itself. I assume there is
> some Smarty syntax, eg {datagrid name="mydatagrid"} or some such. Please
> advise.
No, Smarty knows nothing about what you're doing. Use
$dg->renderer->toHtml() to save the output, then assign it to Smarty
and output it like any other variable.
--
Justin Patrin