views:

904

answers:

1

I have a page which returns results that are filtered on an organization_id. The URL looks like this:

nameofview/organization_id:1/page:2/

I'm using the built in Paginator controls and I pass $this->PassedArgs into it like this:

<div class="paging">
    <?php echo $paginator->prev('<< '.__('previous', true), array('url' => $this->PassedArgs), null, array('class'=>'disabled'));?>
 |  <?php echo $paginator->numbers(array('url' => $this->passedArgs));?>
    <?php echo $paginator->next(__('next', true).' >>', array('url' => $this->passedArgs), null, array('class'=>'disabled'));?>
</div>

The links look good for the "numbers" but don't work for Next and Previous. The links for both are taking me back to the same page. I think it is because it is passing the "Page" param.

Anyone have an idea how I can pass the correct args to $paginator->numbers?

I tried $this->passedArgs['organization_id'] but that returns errors.

+1  A: 

Try this at the top of your view:

$paginator->options(array('url' => $this->passedArgs));

That way, you can drop array('url' => $this->passedArgs) from your prev/next/numbers lines, it should work just fine.

dr Hannibal Lecter
Great! I was trying something much more complicated. This should work =)
Julio Greff
You rock. That worked perfectly.
Ry