Have you looked into admin routing?
You'll just need to prefix your actions and your views with "admin_" to get
it to work (and enable it in app/core.php)
And then set up a route for your admin homepage, which would point to
AdministratorsController::admin_dashboard()
Router::connect('/admin', array('controller' => 'administrators', 'action'
=> 'dashboard', 'admin' => 'admin'));
Hope that helps,
Adam
----- Original Message -----
From: "Leonard Teo" <[email protected]>
To: "CakePHP" <[email protected]>
Sent: Thursday, February 26, 2009 12:25 AM
Subject: How to set up site structure with Admin folder and controllers?
>
> Hi,
>
> I'm an experienced PHP developer that's just started using Cake.
> Apologies in advance if this is a n00bish question.
>
>
> I've created several models, controllers and scaffolds but I would
> like them all to reside in a /admin folder in the site structure.
>
>
> E.g. Models
> - Administrator
> - Story
> - File
>
>
> The default cake site structure is this:
> root/administrators
> root/stories
> root/files
>
> How do I set Cake up so that all the above go into a backend
> directory?
>
> E.g:
>
> root/admin/administrators
> root/admin/stories
> root/admin/files
>
>
> I would also like to create an admin controller so that the homepage
> for admin will show a dashboard:
> e.g.
> root/admin/..... will show a backend dashboard.
>
>
> I've been generally good at finding my way around but was unable to
> find information on doing this - If anyone could help point me in the
> right direction, that'd be great.
>
> Thanks!! :)
>
> Leo
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---