Re: beautiful link with pagination with search

2009-04-07 Thread catfish

That is even better with the paginator->options. Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: beautiful link with pagination with search

2009-04-06 Thread brian

On Mon, Apr 6, 2009 at 12:28 AM, catfish  wrote:
>
> new member here.
>
> I am playing with cake now. One problem that bothers me is the search
> function. The search function will process post data, when in
> pagination, the paginator does not pass the search src.
>
> For example, I would like:
>
> site.com/search/search-string/page:1
>
> In stead, the paginator would only show
>
> site.com/search/page:1
>
> The solution is:
>
> in your view, add 'url'=>$paginator->params['pass']
> for example,
>
> $paginator->numbers(array('url'=>$paginator->params['pass']));
>
> This will allow paginator to pass the search string in the link.

You can also do:

$paginator->options(array('url'=>$paginator->params['pass']));

.. and then you needn't include that in each of your calls to
numbers(), prev(), next(), etc.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



beautiful link with pagination with search

2009-04-06 Thread catfish

new member here.

I am playing with cake now. One problem that bothers me is the search
function. The search function will process post data, when in
pagination, the paginator does not pass the search src.

For example, I would like:

site.com/search/search-string/page:1

In stead, the paginator would only show

site.com/search/page:1

The solution is:

in your view, add 'url'=>$paginator->params['pass']
for example,

$paginator->numbers(array('url'=>$paginator->params['pass']));

This will allow paginator to pass the search string in the link.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---