For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > March 2007 > Re: [PEAR] How to override Pager and Pager_Wrapper default HTML?









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] How to override Pager and Pager_Wrapper default HTML?
Lorenzo Alberton

2007-03-14, 7:06 pm

Charles Kline wrote:
> Could anyone point me in the right direction where to start with
> overriding the default HTML used to output links, etc. in Pager using
> Pager_Wrapper?
>
> What I am trying to do is modify the output of $paged_data['links'] but
> I am not sure where this is defined.


if you look at the body of Pager_Wrapper_MDB2(),
you'll see that $pager->links is assigned to
$paged_data['links']:

$page['links'] = $pager->links;

and $pager->links is created within Pager_[Sliding|Jumping]::build()
as "first + prev + links + next + last".

You can create your own Pager_Custom class
extending Pager_Sliding or Pager_Jumping
(or the base Pager_Common class), then use
it this way:

$options = array(
'mode' => 'Custom',
//... your other options
);

$pager =& factory($options);
//or
$paged_data = Pager_Wrapper_MDB3($db, $query, $options);

HTH

Regards,
--
Lorenzo Alberton
http://pear.php.net/user/quipo
________________________________________
___________________________
Quipo Free Internet - 2 email, 150 Mb di spazio web e molto di pił.
ADSL, hardware & Software Online Store
Sponsored Links







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

Copyright 2008 codecomments.com