Tuesday, February 28, 2012

Re: big confusion with 2.x pagination

Sorry for the noise. It figures that I'd agonize over this for days,
then spot the problem just minutes after giving and pleading for help.

The issue is that 'page' is now expected to be under 'named' in
$this->request->params.

My route:

Router::connect(
'/admin/contributors/:page',
array(
'admin' => 1,
'controller' => 'contributors',
'action' => 'index'
),
array(
'page' => '[0-9]+'
)
);

I like my routes the way they are so I made a quick fix in
AppController::beforeFilter()

if (isset($this->request->params['page']))
{
$this->request->params['named']['page'] = $this->request->params['page'];
}

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: