I. What is MVCthinkphp's MVC mode is very flexible, even if only three or one of them can be run. M-Model write model class to operate on data V-View write html...
I. What is MVC thinkphp's MVC pattern is very flexible, even if only three or one of them can be run.
M-Model write model class to operate data
V-View: compile html files and display pages
C-Controller: write a class file (UserAction. class. php)
II. ThinkPHP MVC features // understanding
III. ThinkPHP MVC Directory // learn more
M project directory/application directory/Lib/Model
V project directory/application directory/Tpl
C project directory/application directory/Lib/Action
4. url access C // learn more
5. four url access methods // Highlights!
1. PATHINFO mode-focus on a lot of use later,If you want to pass multiple parameters, you can use the key 1/value 1/Key 2/value 2 method.
Http: // domain name/project name/entry file/module name/method name/key 1/value 1/Key 2/value 2
2. the normal mode is also called the rewrite mode.
Http: // domain name/project name/entry file? M = module name & a = method name & key 1 = value 1 & Key 2 = value 2
3. REWRITE mode, removing entry files for SEO optimization
Http: // domain name/project name/module name/method name/key 1/value 1/Key 2/value 2
4. compatibility mode
Http: // domain name/project name/entry file? S = module name/method name/key 1/value 1/Key 2/value 2
How to modify/in the PATHINFO address-in Home/Conf/config. php
'URL _ PATHINFO_DEPR '=>'-', // modify the RUL separator and replace the parameter part in the address bar-
Http: // domain name/project name/entry file/module name-method name-key 1-value 1-key 2-value 2
Enable the call mode in index. php to prevent file caching from affecting development in post-production mode
Define ('app _ debug', ture); // if it is set to true, files are cached if false.
Method for enabling REWRITE mode
Find rewrite_module modules/mod_rewrite.sl in httpd. conf and remove # From the restart service. Create. htaccess. php in the entry file. rewrite the file to remove index. php:
- RewriteEngine on
- RewriteCond % {REQUEST_FILENAME }! -D
- RewriteCond % {REQUEST_FILENAME }! -F
- RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]