Welcome Guest, Not a member yet? Register   Sign In
I need a little help with planning my application... (noob alert!)
#11

[eluser]wiredesignz[/eluser]
MVC is a software design pattern, originally intended for desktop applications, it is not open to interpretation.

CodeIgniter allows us to use the MVC design pattern if we choose to, but it is not a requirement.

Controllers are the application manager, they manage application flow, they instruct models to obtain data for the application and decide what content views should display.

Models are your connection to a data source, be it MySQL, XML, file based, or hard coded, they provide your application with data.

Views are the output and user interface for your application. Views may contain enough intelligence (PHP) to manage themselves to obtain the desired result. Views may also request information from models in the original MVC design pattern.
#12

[eluser]xwero[/eluser]
Models are the workhorse classes of the pattern. Everything that has something to do with data is best placed in a model. Here i show how to put the validation in a model and load in by default before the controller method runs. This makes it easier to maintain and debug.

Basically the controller and it's methods are hooks to the outside world and inside the application most things are handled by models and views.




Theme © iAndrew 2016 - Forum software by © MyBB