Mvc,mvc Framework _php Tutorial

Source: Internet
Author: User

MVC,MVC Frame


Mvc

is not a technology, is a kind of thought, the user operation of the site, and the background of the user operation of the processing (including the operation of the database) a separate idea.

Background PHP is always called by the user's behavior, to set the operation entry for the user's behavior,

Operation Portal : The essence is to use the URL (only one privlege.php?action= value, goods.php?action= value)

Backstage :

Parse URL to get URL according to action to Judge C in ==>mvc

According to the different action (behavior) Operation database, get the M in data ==>mvc

using the include introduces an HTML file (template) for echoing information to the user ==> MVC v

M: (module) model is mainly used to manipulate the corresponding data table (table corresponding class goods.class.php, category.class.php, user.class.php)

V: (view) is an HTML document for hosting PHP echo data

C: (Controller) controllers are mainly used for business logic processing, the direction of the control program flow

Image metaphor:

The user is the company's big Boss

C (privilege.php, goods.php, index.php) Company's mid-level

The user issued a command, the company middle-level received the command (a command can be divided into several steps: 1, read data is a step, 2, echo data to the user), the company's middle school sent the younger brother 1 (user.class.php, goods.class.php) to read data, younger brother 1 to return the data to the company middle , the company to the middle of the data to the younger brother 2, the younger brother and second display data.

user.class.php, goods.class.php why to inherit DB class.

There are only four ways to operate a database. This type of operation is applied to different modules and will reflect different transactions. Therefore, it is not possible to encapsulate the business of each module in the DB class, using model classes to encapsulate the different services of the site module.

The user is manipulated by the programmer "expected" behavior, the user can only click the button or a link, that a linked href is designed by the programmer.

MVC diagram:

Expand:

http://www.bkjia.com/PHPjc/1117392.html www.bkjia.com true http://www.bkjia.com/PHPjc/1117392.html techarticle MVC,MVC Framework MVC is not a technology, is a kind of thought, the user operation of the site, and the background of the user operation of the processing (including the operation of the database) a separate idea. Backstage ...

  • 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.