[Solar-talk] pager helper

Rodrigo Moraes rodrigo.moraes at gmail.com
Thu Jan 11 02:51:23 PST 2007


On 1/11/07, Jeff Surgeson wrote:
> Hi Rodrigo
>
> Was playing with your pager helper (latest svn) and cant seem to pass any user
> config to the pager decorator to change the class etc, what am I missing,
> have tried all the following:
>
> $config = array(
>         'adapter'               => 'Jumping',
>         'delta'                         => 3,
>         'show_first_page'       => false,
>         'show_last_page'        => false,
>         'expanded'              => false,
>         'display'                       => array(
>             'list_type'         => 'ol',
>             'list_class'        => 'mypagingclass',
>         )
> );
>
> $pager = $this->pager($href, $this->page, $this->pages, $config);
> echo $pager->fetch();

Hi, Jeff.

The display options are passed to fetch(), so you should try:

    echo $this->pager($href, $this->page, $this->pages,
$config)->fetch('pagesList', $config['display']);

fetch() receives the helper name that will build the list and its
display configuration. Looking at it now, it seems strange to force
the helper name to be passed, but if you want to change the display
config that's the way it works now.

Sorry for the changes, but the Pager helpers were reviewed and almost
rewritten some time ago. You'll need some locale definitions now:

    // Pager
    'PAGER_PAGE_QUERY'         => 'pagina',
    'PAGER_PREVIOUS_PAGE'      => 'Página Anterior',
    'PAGER_NEXT_PAGE'          => 'Próxima Página',
    'PAGER_FIRST_PAGE'         => 'Primeira Página',
    'PAGER_LAST_PAGE'          => 'Última Página',
    'PAGER_PAGE_X'             => 'Página $d',
    'PAGER_PAGE_X_OF_Y'        => 'Página %1$d de %2$d',

(which means that you'll need a getText-with-replacements helper,
because Solar's one doesn't allow direct replacements)

Let me know if it works.

rodrigo


More information about the solar-talk mailing list