Hey.
First, please excuse my terrible English. Today I need a pagination
solution, but I can't get it alone. So please look up on my code:
In the Controller:
function index($page=null){
$videos = $this->Video->find('all');
$this->set('videos',$videos);
$this->set('videos', $this->paginate('Video'));
}
In the View:
echo $paginator->numbers();
The Route:
Router::connect ('/video/*', array('controller'=>'videos',
'action'=>'index'));
This works great, but I need an other pagination URL 'layout'.
Now: /video/page:1
Now: /video/page:2
Need: /video/1/
Need: /video/2/
The only solution i have found and works, is the following route set
up. It works, but it seems really not to be really practicable. The
'improved' routes:
Router::connect ('/video/', array('controller'=>'videos',
'action'=>'index'));
AND...
Router::connect('/video/1/',array('controller' => 'videos', 'action'
=> 'index', 'page' => '1'));
Router::connect('/video/2/',array('controller' => 'videos', 'action'
=> 'index', 'page' => '2'));
Yes it works, but if i need 100 and more pages, i run in a problem :-
(. I found an other solution, but this one works not really good:
Router::connect ('/video/', array('controller'=>'videos',
'action'=>'index'));
AND..
Router::connect('/video/:page/*',array('controller' =>
'videos','action' => 'index'));
This solution rewrites the URL to:
/video/1/page:1
/video/2/page:2
Now i need your help! Please.
Regards, chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---