This is an original figure I saw on Ruan Yifeng's blog: www. ruanyifeng. comblog201502mvcmvp_mvvm because the company uses the YII framework at ordinary times, it is suddenly different from what I understand MVC. It is because the MVC diagram I understand comes from the book: web-ap...
This is a picture I saw on Ruan Yifeng's big blog.
Address: http://www.ruanyifeng.com/blog/2015/02/mvcmvp_mvvm
Because the company uses the YII framework at ordinary times, it suddenly differs from the MVC that I understand. It is the MVC that I understand.
Figure from book: web-application-development-with-yii-and-php
Is the focus of the MVC model only on the three layers of MVC? Which of the following communication methods is related to the framework?
Reply content:
This is a picture I saw on Ruan Yifeng's big blog.
Address: http://www.ruanyifeng.com/blog/2015/02/mvcmvp_mvvm
Because the company uses the YII framework at ordinary times, it suddenly differs from the MVC that I understand. It is the MVC that I understand.
Figure from book: web-application-development-with-yii-and-php
Is the focus of the MVC model only on the three layers of MVC? Which of the following communication methods is related to the framework?
The front-end controller (Routing) is not a necessary design pattern for MVC.
The core idea of MVC is to separate the interface (View), logic (Controller), and data (Model ).
For example, the browser accesses the page controller, the controller processes input, calls the model to obtain data, and loads the view output data.
/Post. php? Id = 1024 // page controller (input ID, output article)
/Include/functions. php's render () function:
function render($template, array $data = array()) { global $app; ob_start(); require APP_ROOT.'themes/'.$app['theme'].'/'.$template; $view = ob_get_contents(); ob_end_clean(); return $view;}
Mvc is just an idea. Different Languages and frameworks have their own implementations and improvements. Just like Jack wrote, they only have different focuses on the three layers of m v c.
Ruan Yifeng is wrong either, or he has his understanding. Mvc is not unidirectional. There are many lines between m v c. And mvc is mvc. Do not drag other db request router in.
It is recommended that you do not use any mvc concept at the beginning. You will naturally understand it when you find a framework to use.