I've been fighting with this today as well.  I have a route set up:
Router::connect('/admin', array('controller' => 'pages', 'action'
=>'index', 'prefix' => Configure::Read('Routing.admin')));

Which gets me to the admin main page.  However $html->link() doesn't
recognize that you're currently in an admin route.

With the recent changes away from CAKE_ADMIN to using Configure::*
what's the way to force an admin route based on the value of
Routing.admin in a $html->link() call?  (i.e. if a user is logged in
and admin, I might want admin links to show up on standard pages, but
I don't want to hard code /admin for flexibility).



On Oct 29, 8:22 pm, cakeFreak <[EMAIL PROTECTED]> wrote:
> Right guys,
> what I' trying to achieve is a kindaadmin/home page, that holds my
> Routing.admin.
> I set my Routing.adminas *admin*
>
> ------------------------------------------------------------------
> Configure::write('Routing.admin', 'admin');
> ------------------------------------------------------------------
>
> I tryed 2 strategies:
> 1) build an admin_controller.php with a admin_index() and index()
> methods
>
> 2) create an action in the pages_controller.php called lets sayadmin() and 
> than use the Router like
> ------------------------------------------------------------------
> Router::connect('/admin', array('controller' => 'pages', 'action' =>
> 'display', 'admin'));
> ------------------------------------------------------------------
>
> Approach #1 didn't work out.
> Approach #2 worked out, but it does not keep the admin_routing in 
> myadminmenu. Namely if in myadminmenu I have a link to *posts*, when
> I go towww.mysite.com/adminmy link changes
>
> from->www.mysite.com/admin/posts
> to->www.mysite.com/posts
>
> How can I reroute my MAINadminpage without loosing the authomagic of
> myADMIN.ROUTED menu links?
>
> Cheers in advance for your replays!
>
> Dan
>
> PS: I also tryed
> ------------------------------------------------------------------
> Router::connect('/admin', array('controller' => 'pages', 'action' =>
> 'display', 'admin_index'));
> -----------------------------------------------------------------
>
> but it didn't work.


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

Reply via email to