Welcome Guest, Not a member yet? Register   Sign In
Best pratice in relation views - controllers
#1

[eluser]Pintossauro[/eluser]
Hello everyone!

I'm new to CI and I want to start developing a web application where i'll have some projects with registered users.

I'm posting here to see if i'm getting the right idea of views and controllers.

In the image below you can see my application flow (very simplified).

So I've a view where you can see the users that have access to a project and a link to add more users to that project. When you click that link the system will call the function add_user() in the project controller. Then this controller gets all the other users in the database (and not already defined to that project) and sends the data to another view where you could see a drop-down menu with the users you can add to the project. Finally, when you press "Add!" this will call another function in the project controller where the data will be updated in the DB and its displayed the primary view with the new information.

(I hope its not too confusing Tongue)

So my question is: Is this the right approach? May I've too many views (or functions) just to do one thing. Or maybe not Tongue

What do you think? Thanks for your attention and sorry for any English errors Wink

Thanks in advance,
Pintossauro.




Theme © iAndrew 2016 - Forum software by © MyBB