For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2006 > Re: [PEAR] Pager_Wrapper?









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] Pager_Wrapper?
Olivier Guilyardi

2006-03-22, 7:00 pm

Hi Hugo,

Pager has been integrated with Structures_DataGrid for a long time. You don't
need Pager_Wrapper.

Example :
$renderer =& $datagrid->getRenderer();
echo $renderer->getPaging();

--
og

Hugo W. Alves wrote:
> Hi People,
>
> Someone did a integration class between Pager_Wrapper.php and DataGrid yet? I wanna use DataGrid with the Pager_Wrapper!
>
> Hugo Alves.
> Porto Alegre - Brasil
>
>
> ---------------------------------
> Yahoo! Search
> Dê uma espiadinha e saiba tudo sobre o Big Brother Brasil.

Hugo W. Alves

2006-03-22, 7:00 pm

Thanks for your atention Oliver! Well, I wanna to use Pager_Wrapper.php why this code performs a smarty pagination using Pager Package with query results. I wanna means that it performs a query limit for each page instead of all result, you know?

Hugo Alves.
Brasil

Olivier Guilyardi <ojaiml@nerim.net> escreveu: Hi Hugo,

Pager has been integrated with Structures_DataGrid for a long time. You don't
need Pager_Wrapper.

Example :
$renderer =& $datagrid->getRenderer();
echo $renderer->getPaging();

--
og

Hugo W. Alves wrote:
> Hi People,
>
> Someone did a integration class between Pager_Wrapper.php and DataGrid yet? I wanna use DataGrid with the Pager_Wrapper!
>
> Hugo Alves.
> Porto Alegre - Brasil
>
>
> ---------------------------------
> Yahoo! Search
> Dê uma espiadinha e saiba tudo sobre o Big Brother Brasil.


--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




---------------------------------
Yahoo! Acesso Grátis
Internet rápida e grátis. Instale o discador agora!
Olivier Guilyardi

2006-03-22, 7:00 pm

Hugo W. Alves wrote:
> Thanks for your atention Oliver! Well, I wanna to use Pager_Wrapper.php why this code performs a smarty pagination using Pager Package with query results. I wanna means that it performs a query limit for each page instead of all result, you know?


Indeed, I know... Who would ever want to load 1000 rows only to display 10 ?

Two drivers currently support SQL LIMIT'ing : dataobject and dbquery.

So you can either do : $datagrid->bind($dataobject);
where $dataobject is a DB_DataObject instance

Or, with Mark's great DBQuery driver, you can do :

$options['dsn'] = <your dsn>
$query = "SELECT * FROM table";
$datagrid->bind($query, $options);

The DBQuery driver rewrites the query in a very similar way to Pager_Wrapper.
However this driver is only available in CVS. But I don't see why you shouldn't
use it, the CVS works ok.

If you prefere to stick with the latest release (0.6.3) then you should use the
dataobject driver which has been there for a long time and is quite reliable.

Regards,

--
og
Mark Wiesemann

2006-03-22, 7:00 pm

Hi,

just some remarks on Olivier's answer.

Olivier Guilyardi wrote:
> Two drivers currently support SQL LIMIT'ing : dataobject and dbquery.


More precisely: SDG has even twice as much drivers that support limiting
-- beside DataObject and DBQuery, there are also MDB2 (behaves the same
way as DBQuery) and DBTable (makes only sense if one uses DB_Table,
another great PEAR package *g*).

> Or, with Mark's great DBQuery driver, you can do :
>
> $options['dsn'] = <your dsn>


Alternatively:
$options['connection'] = <your DB instance>

(maybe we should rename 'connection' to 'dbc' as it was done in
LiveUser, would save some keystrokes)

Regards,
Mark
Sponsored Links







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

Copyright 2008 codecomments.com