views:

181

answers:

1

I'm using the PaginationHelper and in my view I need to set the class for the current page's link to "current number" and I also need to get rid of the | characters before and after the pages.

I can set the overall class but not the current page class using:

<?php echo $paginator->numbers(array('before'=>'','after'=>'','class'=>'number')); ?>

So - I need to generate this:

<div class="pagination"> <a href="#" class="number" title="1">1</a> <a href="#" class="number" title="2">2</a> <a href="#" class="number current" title="3">3</a> <a href="#" class="number" title="4">4</a> </div> <!-- End .pagination -->

But what gets generated is this:

<div class="pagination"> <span class="current">1</span> | <span><a class="number" href="/admin/users/dashboard/page:2">2</a></span> | <span><a class="number" href="/admin/users/dashboard/page:3">3</a></span> | <span><a class="number" href="/admin/users/dashboard/page:4">4</a></span> </div>

Is there a simple way to do this??

Ideally I'd like to remove the spans completely but I don't see a way to do that in the api...

A: 

The following should work

echo $paginator->numbers(array(
    'before' => '',
    'after' => '',
    'separator' => '',
    'tag' => false,
    'class' => 'number'
));

Take a look at the source code, it makes it easier to see what options you can set.

DanCake