Thinkphp entry 4-layout, cache, system variable (48), thinkphp48. Thinkphp entry 4-layout, cache, system variable (48), thinkphp48 [controller operation method parameter settings] URL index. php controller operation method [page jump] Thinkphp entry 4-layout, cache, system variable (48), thinkphp48
[Controller operation method parameter settings]
Http: // URL/index. php/controller/operation method
Page jump]
Variable regulator]
Smarty variable regulator
[Subtemplate inclusion]
The current module contains each other
[Use layout] 1. enable layout and configure variable information config. php
2. create the layout file Tpl/home/layout.html 3. do not use layout {__ NOLAYOUT __}
Layout Group
Home admin
A. Each group has its own configuration file config. php.
B. enable the layout function for each layout file
C. set the layout file for each group
Tp/home/layout.html
Tpl/admin/layout.html
Use custom layout
[Cache usage of tp framework]
Cache variable information (common variables, arrays, objects ),
Cache static html content, cache part or all
Most of our data is obtained from the mysql database.
Cache medium: Memory (memcache), files (solving the database), cache to the database
The data is optimized and stored in the database.
File cache of the tp framework (shortcut function ):
A) set S (name, value)
B) read S (name)
C) delete S (name, null)
1. you can set cache files to different directories for storage.
This prevents a directory from storing too many cached files, affecting performance.
2 Cache validity period
S (name, value, time );
3
Cache settings
4Cache usage:
5. cache deletion
6 cache use cases
System variables]
Use all variables $ _ GET $ _ POST $ _ SESSION $ _ COOKIE in the template.
Constant usage:
$ Think. const. constant name
$ Think. get. name
Get configuration variable information in the template config. php
$ Think. config. name
Get configuration variable information in the controller
C (name); // shortcut function
Original output literal label]
Layout 4-layout, cache, system variable (48), thinkphp48 [controller operation method parameter settings] http: // URL/index. php/controller/operation method [page jump ]...