PHP Learning BBS Forum Project-web Architecture and MVC ideas

Source: Internet
Author: User
Tags one more line

-- display and logic phase separation --

Force the function into two parts:1. The HTML part responsible for the display 2. PHP code responsible for business logic processing

HTML is primarily responsible for the presentation of parts, where mutable data is populated with dynamic scripting PHP.

Such a mixed file is generally called a template file. Because users cannot request template files directly, they are hidden through Apache distributed configuration Files .

In the Apache master configuration file (httpd-vhosts.conf), add one more line of code when you configure permissions:

AllowOverride All

Next, create the . htaccess file in the template file, and write the following code.

Content users in the View template file will no longer be able to access the

Summary: Advantages of display and logical phase separation

-Better management code, high maintainability

-Improve code reusability and efficiency


--MVC thought --

When a website features a lot, such as e-commerce website, a lot of functions are relatively independent data processing module permutation combination. And the idea of MVC architecture, that is, on the basis of display and logical separation, and then the logic of all the data processing modules are extracted separately, in the required functions to debug.

Data processing units in the M-model project

V-view Project for result presentation units (template files)

A unit in the C-controller project that is responsible for the overall process scheduling of a function

At this point the browser only needs to interact with C.

Summary: The concept of MVC architecture, refers to the relationship between the code in the project, does not determine the grammatical form, the process-oriented and object-oriented can use the MVC architecture idea.

PHP Learning BBS Forum Project-web Architecture and MVC ideas

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.