thinkphp 3 MVC mode and URL access

Source: Internet
Author: User

I. What is MVC//understanding
M-model writing Model classes to manipulate data
V-view Writing HTML files, page rendering
C-controller Writing class files (UserAction.class.php)
Second, the MVC features of thinkphp//understanding
Third, thinkphp of the MVC corresponding Directory//understanding
M project directory/application directory/lib/model
V project directory/application directory/TPL
C project directory/application directory/lib/action
Iv. URL Access c//understanding
Five, URL 4 ways to access//focus!
1.PATHINFO Mode--KEY!!!!!!
HTTP//project name/Portal File/Module name/method name/Key 1/value 1/Key 2/value 2
If you want to modify the "/" in the URL, you can add ' url_pathinfo_depr ' = '-' in the configuration file
2. Normal mode
HTTP//Name/project/portal file? m= Module name &a= method name & key 1= value 1& key 2= value 2
Http://192.168.1.11/think/index.php?m=index&a=test
3.REWRITE mode
HTTP//project name/Module name/method name/Key 1/value 1/Key 2/value 2
Need to modify Apache configuration file httpd.conf file
4. Compatibility mode
HTTP//Name/project name/entry file? S= Module Name/method name/Key 1/value 1/Key 2/value 2

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.