Controller Subfolder or Custom Routes? |
[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?
[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' Code: class Admin extends Controller {
[eluser]K-Fella[/eluser]
Thanks for the replies guys 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.
[eluser]K-Fella[/eluser]
<offtopic> Is it just me or does that smiley look more like a rolleyes smiley than a smile smiley! </offtopic> |
Welcome Guest, Not a member yet? Register Sign In |