Are the communication methods of different MVC frameworks different?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.