Welcome Guest, Not a member yet? Register   Sign In
Controller Subfolder or Custom Routes?

If I wanted to use www.domain.com/admin/users/edit/user_id would I need to use Controller subfolders or custom routes?

[eluser]Matthew Pennell[/eluser]
Either/or - it's up to you. I use a sub-folder within controllers, particularly for admin functions (where there are lots of sub-controllers all within the same section).

[eluser]Michael Wales[/eluser]
Subfolders will not effect yours URLs.

In your case, I would do some routing, because you don't want a method named users. passing a parameter edit - you want that to be a method itself.

Just setup up your route to point to 'admin/editusers'

class Admin extends Controller {

  function editusers($id = NULL) {


Thanks for the replies guys Smile I wasn't sure if one option was better than the other. Seeing as I've not bothered with subfolders so far in the project, I think I'll go the routes way.

Is it just me or does that smiley look more like a rolleyes smiley than a smile smiley!

Theme © iAndrew 2016 - Forum software by © MyBB