I'm using Andy's PaginationComponent in an admin action. The first
page loads fine but something's wrong with the route that's causing an
error. Here's the setup:
($page and $show would be set from $this->params or a default)
$criteria = null;
$parameters = array('page' => $page);
$options = array(
'url' => '/admin/events/',
'sortByClass' => 'Event',
'sortBy' => 'date_from',
'direction' => 'DESC',
'show' => $show,
'maxPages' => 10,
'paramStyle' => 'pretty',
'paramSeparator' => ':'
);
list($order, $limit, $page) = $this->Pagination->init($criteria,
$parameters, $options);
So, the links for the other pages are rendered like:
/admin/events/page:3
The result, though, is this error:
The action admin_page3 is not defined in controller EventsController
For some reason, the colon is disappearing (Sanitize?) and the action
is misidentified. I've tried all kinds of different routes (and
removed it altogether) with no luck. How do i configure a route to
handle a URL with "pretty" params with colons such as these? It seems
to me that a colon would interfere with the way routes work, but this
is what I see in the examples.
I had originally been using '/' as the separator and the following
route and URL:
Router::connect('/events/page/:page',
array('controller' => 'events', 'action' => 'index'),
array('page' => '[0-9]+')
);
/admin/events/page/3
But that gives me:
The action admin_page is not defined in controller EventsController
If I prepend '/admin' to the route path I see the default, non-admin
index view.
So, I'd be happy to use either '/' or ':' as the separator, but where
am I going wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---