Tuesday, November 12, 2013

Pagination option url question

Hi,

I used this code:
$this->Paginator->options(array('url' => array($this->params->url)));

and later on:
echo $this->Paginator->link('5',array('limit' => '5'), $options = array('escape' => false));
and
echo $this->Paginator->sort('price', $text, $options = array('escape' => false, 'direction'=>'desc', 'class' => 'asc'));
and
echo $this->Paginator->prev($this->Html->image('arrow_left.png', array('border' => 0, 'tag'=>'li')), array('escape'=>false, 'tag'=>'li'));
echo $this->Paginator->numbers(array('separator' => '', 'tag'=>'li'));
echo $this->Paginator->next($this->Html->image('arrow_right.png', array('border' => 0, 'tag'=>'li')), array('escape'=>false, 'tag'=>'li'));

When I am on the page where I want to use the paginator, I have this url:
http://domain.com/my_slugged_url

My Paginator links look like:
http://domain.com/myController/myAction/my_slugged_url/limit:5
or
http://domain.com/myController/myAction/my_slugged_url/sort:price/direction:desc
or
http://domain.com/myController/myAction/my_slugged_url/page:2

Question one: Can I overwrite the controller and action with my slugged_url value?
To have something like http://domain.com/my_slugged_url/page:2?

Question two: These links work only the first time. The second time they look like this:
http://domain.com/myController/myAction/myController/myAction/my_slugged_url/page:2/page:3
Controller and Action is double and page:3 got added after page:2

Anyone an idea what could be wrong here or broken?
This happens even, when I remove the options line from the beginning.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: