For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2006 > Re: [PEAR] Problem rendering Structures_DataGrid with Smarty









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] Problem rendering Structures_DataGrid with Smarty
Olivier Guilyardi

2006-06-26, 7:01 pm

Hi Andrew,

Andrew Teixeira wrote:
> I have been happily using SDG (0.6.3) for a while now in conjunction
> with Smarty. Everything was going fine until I decided to upgrade to
> the new 0.7.1 system. I downloaded 0.7.1 with all its requisite
> DataSource and Renderer packages. I then tried to convert from the
> 0.6.3 way of doing things to 0.7.1's somewhat different process.


Yes the Smarty driver has much changed. I understand you're .

>
> $renderer =& $dataGrid->getRenderer();
> $renderer->setContainer($this->_template);
> $dataGrid->fill($this->_template);
>
> $template =& $renderer->getContainer();
> $html = $template->fetch(TEMPLATE_DIR . 'template.tpl');


Just do :

$smarty = new Smarty;
$datagrid->fill($smarty);
$smarty->display(TEMPLATE_DIR . 'template.tpl');

The smarty variables and function are explained at the top of
Structures/DataGrid/Renderer/Smarty.php

Regards,

--
Olivier
Sponsored Links







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

Copyright 2008 codecomments.com