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

[eluser]K-Fella[/eluser]
If I wanted to use www.domain.com/admin/users/edit/user_id would I need to use Controller subfolders or custom routes?
#2

[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).
#3

[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'

Code:
class Admin extends Controller {

  function editusers($id = NULL) {
  }

}
#4

[eluser]K-Fella[/eluser]
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.
#5

[eluser]K-Fella[/eluser]
<offtopic>
Is it just me or does that smiley look more like a rolleyes smiley than a smile smiley!
</offtopic>




Theme © iAndrew 2016 - Forum software by © MyBB