Hi there,

I would like to get some feedback on a specific approach I'm taking. I
don't know if this is normal and if it's good (CakePHP) coding
practice, since this is my first CakePHP application.

I have added a route in my "/app/config/routes.php" document. It looks
like this :

$Route -> connect('/admin', array('controller' => 'admin', 'action' =>
'index'));

...which takes a user/admin to the index method of the AdminController
controller whenever "/admin/" is accessed.

Now...whenever, let's say "/admin/files/" is accessed, the user will
go to the "admin_index" method/function of the FilesController
controller in my application.

Another example is, let's say a user goes to "/admin/users/" the user
will go to the "admin_index" method/function inside the
UsersController controller.

Last example. The administrator is about to edit a user account and
goes to "/admin/users/edit" with POST or GET data. This will mean that
the "admin_edit" method is executed inside the UsersController
controller.

Is this fine?
What do you think about the approach?
Is it "abnormal" to have my admin functions inside the same controller
used by users?


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