Re: Admin section without using admin routing

2008-06-06 Thread zw

Thanks for the help. When I attempted it, I was using the same names
for both the admin and standard controllers, so maybe there was a
conflict. I'll try to name them differently and see if that works.

For now, what I currently do is what omarh mentioned and is just have
one admin controller, and different actions for different models
(users_edit, products_list, message_delete, etc). The way I have it
configured works pretty well and allows for clean urls (/admin/
products/list). I'd just prefer to separate them into different
controllers.

On Jun 6, 9:52 am, James K <[EMAIL PROTECTED]> wrote:
> The easiest approach would be to do like aranworld suggested and just
> write different controllers for admins. Your controllers don't have to
> be 1:1 with models. I write controllers based on logical grouping of
> functionality as opposed to the literal base model - this also gives
> you more meaningful URLs since your controller names will make more
> sense to the user.
>
> This way you can make adminprofile_controller and profile_controller
> and have them exist in the controllers directory, AND still use admin
> routing if you wanted to.
>
> - James
>
> On Jun 5, 1:05 pm, aranworld <[EMAIL PROTECTED]> wrote:
>
> > The only thing stopping you is that you might come into problems
> > having controllers with the same name.
>
> > If you made a controller named useradmin_controller.php in /
> > controllers/admin, cakephp will find it.
>
> > However, if you have users_controller.php in BOTH /controllers and /
> > controllers/admin, I believe you will run into naming conflicts.
>
> > Overall, I think you will find that it is ultimately easier to mostly
> > use single controllers which contain an index, add, edit, and delete
> > function.
>
> > On Jun 5, 8:58 am, zw <[EMAIL PROTECTED]> wrote:
>
> > > Is there a way to have a separate admin section that doesn't use the
> > > built-in CakePHP admin routing feature? I'd like to be able to set up
> > > my site so there is a folder within controllers called admin, and I
> > > can put all my admin specific controllers. That way I don't have to
> > > have my admin code in my standard controllers and easily use a
> > > separate admin layout. Something like this would be ideal:
>
> > > Router::connect('/admin/:controller/:action/*', array('controller' =>
> > > 'admin/:controller'))
>
> > > Then i can have:
> > > /app
> > >   /controllers
> > >     /admin
> > >       posts_controller.php
> > >       users_controller.php
> > >       projects_controller.php
> > >       etc
>
> > > From what I can tell this is not possible, and CakePHP will only look
> > > in app/controllers for controllers. I feel this is a really clean
> > > structure and way of separating the admin functionality.
>
> > > Thanks for your help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Admin section without using admin routing

2008-06-06 Thread James K

The easiest approach would be to do like aranworld suggested and just
write different controllers for admins. Your controllers don't have to
be 1:1 with models. I write controllers based on logical grouping of
functionality as opposed to the literal base model - this also gives
you more meaningful URLs since your controller names will make more
sense to the user.

This way you can make adminprofile_controller and profile_controller
and have them exist in the controllers directory, AND still use admin
routing if you wanted to.

- James

On Jun 5, 1:05 pm, aranworld <[EMAIL PROTECTED]> wrote:
> The only thing stopping you is that you might come into problems
> having controllers with the same name.
>
> If you made a controller named useradmin_controller.php in /
> controllers/admin, cakephp will find it.
>
> However, if you have users_controller.php in BOTH /controllers and /
> controllers/admin, I believe you will run into naming conflicts.
>
> Overall, I think you will find that it is ultimately easier to mostly
> use single controllers which contain an index, add, edit, and delete
> function.
>
> On Jun 5, 8:58 am, zw <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to have a separate admin section that doesn't use the
> > built-in CakePHP admin routing feature? I'd like to be able to set up
> > my site so there is a folder within controllers called admin, and I
> > can put all my admin specific controllers. That way I don't have to
> > have my admin code in my standard controllers and easily use a
> > separate admin layout. Something like this would be ideal:
>
> > Router::connect('/admin/:controller/:action/*', array('controller' =>
> > 'admin/:controller'))
>
> > Then i can have:
> > /app
> >   /controllers
> >     /admin
> >       posts_controller.php
> >       users_controller.php
> >       projects_controller.php
> >       etc
>
> > From what I can tell this is not possible, and CakePHP will only look
> > in app/controllers for controllers. I feel this is a really clean
> > structure and way of separating the admin functionality.
>
> > Thanks for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Admin section without using admin routing

2008-06-05 Thread omarh

I have used two aproaches to solve this.

The first is to make a subdomain (admin.domain.com) with another cake
install, but can get a little messy.

The other is to use an admin controller in where I define all the
admin functions (edit_products, add_products, edit_clients, etc.),
using their respective models. I have dificulties with pagination
using this approach, nothing that can't be solved.


On Jun 5, 12:05 pm, aranworld <[EMAIL PROTECTED]> wrote:
> The only thing stopping you is that you might come into problems
> having controllers with the same name.
>
> If you made a controller named useradmin_controller.php in /
> controllers/admin, cakephp will find it.
>
> However, if you have users_controller.php in BOTH /controllers and /
> controllers/admin, I believe you will run into naming conflicts.
>
> Overall, I think you will find that it is ultimately easier to mostly
> use single controllers which contain an index, add, edit, and delete
> function.
>
> On Jun 5, 8:58 am, zw <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is there a way to have a separate admin section that doesn't use the
> > built-in CakePHP admin routing feature? I'd like to be able to set up
> > my site so there is a folder within controllers called admin, and I
> > can put all my admin specific controllers. That way I don't have to
> > have my admin code in my standard controllers and easily use a
> > separate admin layout. Something like this would be ideal:
>
> > Router::connect('/admin/:controller/:action/*', array('controller' =>
> > 'admin/:controller'))
>
> > Then i can have:
> > /app
> >   /controllers
> >     /admin
> >       posts_controller.php
> >       users_controller.php
> >       projects_controller.php
> >       etc
>
> > From what I can tell this is not possible, and CakePHP will only look
> > in app/controllers for controllers. I feel this is a really clean
> > structure and way of separating the admin functionality.
>
> > Thanks for your help.- Hide quoted text -
>
> - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Admin section without using admin routing

2008-06-05 Thread Stephen Orr

Or you could do what I've done in the past on several occasions and
create a plugin called 'admin', which will allow you to have URLs such
as /admin/users/add.

Works fairly well, and you can define a separate layout just by
including in your plugin a /views/layouts/default.ctp file.


On Jun 5, 6:05 pm, aranworld <[EMAIL PROTECTED]> wrote:
> The only thing stopping you is that you might come into problems
> having controllers with the same name.
>
> If you made a controller named useradmin_controller.php in /
> controllers/admin, cakephp will find it.
>
> However, if you have users_controller.php in BOTH /controllers and /
> controllers/admin, I believe you will run into naming conflicts.
>
> Overall, I think you will find that it is ultimately easier to mostly
> use single controllers which contain an index, add, edit, and delete
> function.
>
> On Jun 5, 8:58 am, zw <[EMAIL PROTECTED]> wrote:
>
> > Is there a way to have a separate admin section that doesn't use the
> > built-in CakePHP admin routing feature? I'd like to be able to set up
> > my site so there is a folder within controllers called admin, and I
> > can put all my admin specific controllers. That way I don't have to
> > have my admin code in my standard controllers and easily use a
> > separate admin layout. Something like this would be ideal:
>
> > Router::connect('/admin/:controller/:action/*', array('controller' =>
> > 'admin/:controller'))
>
> > Then i can have:
> > /app
> >   /controllers
> >     /admin
> >       posts_controller.php
> >       users_controller.php
> >       projects_controller.php
> >       etc
>
> > From what I can tell this is not possible, and CakePHP will only look
> > in app/controllers for controllers. I feel this is a really clean
> > structure and way of separating the admin functionality.
>
> > Thanks for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Admin section without using admin routing

2008-06-05 Thread aranworld

The only thing stopping you is that you might come into problems
having controllers with the same name.

If you made a controller named useradmin_controller.php in /
controllers/admin, cakephp will find it.

However, if you have users_controller.php in BOTH /controllers and /
controllers/admin, I believe you will run into naming conflicts.

Overall, I think you will find that it is ultimately easier to mostly
use single controllers which contain an index, add, edit, and delete
function.

On Jun 5, 8:58 am, zw <[EMAIL PROTECTED]> wrote:
> Is there a way to have a separate admin section that doesn't use the
> built-in CakePHP admin routing feature? I'd like to be able to set up
> my site so there is a folder within controllers called admin, and I
> can put all my admin specific controllers. That way I don't have to
> have my admin code in my standard controllers and easily use a
> separate admin layout. Something like this would be ideal:
>
> Router::connect('/admin/:controller/:action/*', array('controller' =>
> 'admin/:controller'))
>
> Then i can have:
> /app
>   /controllers
>     /admin
>       posts_controller.php
>       users_controller.php
>       projects_controller.php
>       etc
>
> From what I can tell this is not possible, and CakePHP will only look
> in app/controllers for controllers. I feel this is a really clean
> structure and way of separating the admin functionality.
>
> Thanks for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Admin section without using admin routing

2008-06-05 Thread zw

Is there a way to have a separate admin section that doesn't use the
built-in CakePHP admin routing feature? I'd like to be able to set up
my site so there is a folder within controllers called admin, and I
can put all my admin specific controllers. That way I don't have to
have my admin code in my standard controllers and easily use a
separate admin layout. Something like this would be ideal:

Router::connect('/admin/:controller/:action/*', array('controller' =>
'admin/:controller'))

Then i can have:
/app
  /controllers
/admin
  posts_controller.php
  users_controller.php
  projects_controller.php
  etc

>From what I can tell this is not possible, and CakePHP will only look
in app/controllers for controllers. I feel this is a really clean
structure and way of separating the admin functionality.

Thanks for your help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---