In case web development, we often hear about MVC. What is MVC? That abbreviation of Model – View – Controller concept. Smalltalk Programmer Trygve Reenskaug created this concept in 1979, long time ago before internet booming era. The program architecture significantly different than procedural programming. Many people said MVC have advantage make program more efficient and secure.
let’s take a look inside a MVC Architecture, which basically consist of three main part ( in separate folder ) and connected each other :
This is place where the web part visible to user, view attached to model where required to get some data update. You can set up style , color and size by include css in this part.
View example :
public function _construct(Controller $xcontrol, Model $ymodel)
$this->controller = $xcontroller;
$this->model = $ymodels;
public function display()
That is handle event from view, but this is not media between view and model. Although receive user’s input and send commands to model for update data, view get their own data from model.
public function _construct(Model $zmodel)
This most complex part of MVC, store data which required by view. in other word, you can call it skeleton of program. The HTML or other main data like text you can put here
Model Example :
public function _construct()
$this->word = ‘ Hello world';
$model = new Model();
$controller = new Controller($zmodel);
$view = new View($xcontroller, $ymodel);
MVC implementation not only in php, but in other language like java, ASP or other. Especially for web development, this concept used by all frameworks like codeigniter, laravel, zend framework, symphony.