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
-~----------~----~----~----~------~----~------~--~---

Reply via email to