#
# thinkphp 3 MVC mode and URL access
#
Lecturer: Zhao Tun
Weibo: Http://weibo.com/zhaotongzheng
This lesson outlines:
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
2. Normal mode
HTTP//Name/project/portal file? m= Module name &a= method name & key 1= value 1& key 2= value 2
3.REWRITE mode
HTTP//project name/Module name/method name/Key 1/value 1/Key 2/value 2
4. Compatibility mode
HTTP//Name/project name/entry file? S= Module Name/method name/Key 1/value 1/Key 2/value 2
#
# I join part
#
VI. Configuration Item//conf/config.php
' Url_pathinfo_depr ' = '-',//Modify the delimiter of the URL
Seven, open rewrite function//apache the main directory/conf/httpd.conf
Search rewrite, remove the front #
Then create a new. Htaccess content entry in the thinkphp root directory
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]
</ifmodule
Eight, open the debug mode
Entry file index.php input define (' Add_debug ', true);
Brother even new thinkphp video tutorial 2.ThinkPHP 3.1.2 MVC mode and URL access