Welcome Guest, Not a member yet? Register   Sign In
Newbie question
#1

[eluser]CheekyGeek[/eluser]
Greetings all.
CI newbie, just hatched. Working my way through the User Guide and following along with the two CI video tutorials. I'm having some trouble translating my vision into the CI/MVC way.

For example, lets take a simple "users" database table that will be under an Admin's control. We will want to be able to:
-list all users
-add a user
-update a user record (change the contents of some field)
-delete a user

So am I going to want to create an Admin controller that contains all of the following?
-function list_all_users
-function add_user
-function update_user
-function delete_user

OR

am I going to want separate controllers for each of those functions?

Or should I think not in terms of access (like Admin) but in terms of units (like "user"). If I had a controller named "user" then I could have functions:
-list
-new
-update
-delete
???
I guess I'll get to how to restrict access to those functions/forms as I go along here.

And if a function/controller "user/new and load a "new_user" (view) do I have the form action submit back to the user/new function/controller or use a different one, like user/add?

Just putting these questions down on paper has helped me a little, but if anyone can tell me if I'm on the right track (or off in the weeds already) would be greatly appreciated. Thanks in advance!


Messages In This Thread
Newbie question - by El Forum - 06-20-2008, 08:41 PM
Newbie question - by El Forum - 06-21-2008, 05:36 AM
Newbie question - by El Forum - 06-21-2008, 07:26 AM
Newbie question - by El Forum - 06-21-2008, 10:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB