I think you misunderstood me.
I have two admin routes (Defined using Configure::write
('Routing.admin', 'admin') and Configure::write
('Routing.courseadmin', 'courseadmin')). "admin" is for system
administrators, and 'courseadmin' is for Course administrators. The
"admin" route works 100%, and the 'courseadmin' works 95%.
The 5% that is not working is the pagination links ($paginator->first,
etc.). In the 'admin' route the generated urls are correct (/admin/
students/index...), but in the 'courseadmin' route the generated urls
are wrong (/students/courseadmin_index). URLs that are generated with
the html helper works fine in both routes.
On Mar 17, 6:10 pm, brian <[email protected]> wrote:
> On Tue, Mar 17, 2009 at 8:37 AM, Walther <[email protected]> wrote:
>
> > I am struggling to get custom admin routing to work with pagination.
>
> > I have a custom admin route called 'courseadmin'. This works fine, but
> > when I try to do pagination in a view (courseadmin/students/index) the
> > pagination link links to "/students/courseadmin_index".
>
> > I suppose I could fix it with a route, but I'm not sure how, any
> > suggestions.
>
> function admin_index()
> {
> ...
>
> }
>
> Router::connect(
> '/courseadmin/students/index',
> array(
> 'controller' => 'students',
> 'action' => 'index',
> 'admin' => 1
> )
> );
>
> $html->link(
> 'link text here',
> array(
> 'controller' => 'students',
> 'action' => 'index',
> 'admin' => 1
> ),
> array('title' => '...')
> );
>
> The thing with routes is you should start with your desired URL, then
> define the controller, action, etc. When you use HtmlHelper to create
> links, just use the array "definition" from the route and it should
> return your desired URL.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---