Thinkphp Getting started four-layouts, caches, System variables (THINKPHP48)
"Controller action method parameter settings"
http://URL/index.php/Controller/operation method
"Page Jump"
"Variable Adjuster"
Smarty Variable Adjuster
"Child template contains"
Current modules contain each other
"Using layout layouts"
1. Open the layout and configure the variable information config.php
2. make layout file tpl/home/layout.html
3. Do not use layout {__nolayout__}
Layout grouping
Home Admin
A, each group has its own configuration file config.php
B. Set the layout opening function for each layout file
C, set the layout file for each group
Tp/home/layout.html
Tpl/admin/layout.html
Using the custom layout
"TP Framework Cache use"
Cache variable information (normal variable, array, object),
Caching static HTML content, caching part or all
The most of our data is obtained from the MySQL database.
Cache Media: Memory (memcache), file (resolve database), cache to database
The data is optimized and stored inside the database.
File cache for TP framework (shortcut function):
A) Set S (name, value)
b) Read S (name)
c) Remove S (name, NULL)
1 You can set the cache file to a different directory to store
This prevents a directory from storing too many cache files, which can affect performance
2 Cache Expiration
S (name, value, time);
3 Cache Settings
4 Cache Usage:
5 Cache deletion
6 Caching Use Cases
"System Variables"
Use all variables inside the template $_get $_post $_session $_cookie, etc.
Constants use:
$Think. Const. Constant name
$Think. Get. Name
Get configuration variable information inside the template config.php
$Think. config. name
Get configuration variable information inside the controller
C (name); Shortcut functions
"Output literal label as-is"
http://www.bkjia.com/PHPjc/1014827.html www.bkjia.com true http://www.bkjia.com/PHPjc/1014827.html techarticle thinkphp Getting Started four-layout, cache, System variable (THINKPHP48), "Controller action method parameter settings" http://URL/index.php/controller/How to "page Jump" ...