Welcome Guest, Not a member yet? Register   Sign In
Controller organization question
#7

[eluser]Michael Wales[/eluser]
I name all of my controllers the plural of my tables - there are a few obscure controllers out there, that don't pertain to a table - but this is a general rule of thumb.

All of my models are the singular of the table - since they refer to the data for a single object (the data that defines a user, or a blog post, etc).

My views are all placed within subfolders with the same name as the controller that calls them (except for the _global folder, which is used for header, footer, nav, etc).

So, a user registration form would be something similar to:
Controller: users->signup()
Model: user
View: users/signup.php

Finally, if I don't like the way the URL looks by default, I use routing. This would make the registration url: domain.com/signup
Code:
$route['signup'] = 'users/signup';


Messages In This Thread
Controller organization question - by El Forum - 01-21-2008, 10:12 PM
Controller organization question - by El Forum - 01-22-2008, 01:14 AM
Controller organization question - by El Forum - 01-22-2008, 01:16 AM
Controller organization question - by El Forum - 01-22-2008, 02:12 AM
Controller organization question - by El Forum - 01-22-2008, 02:42 AM
Controller organization question - by El Forum - 01-22-2008, 09:41 AM
Controller organization question - by El Forum - 01-22-2008, 10:27 AM
Controller organization question - by El Forum - 01-22-2008, 02:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB