http://website/index.php/controller/operation method
[Page jump]
【Variable Regulator】
Smarty variable regulator
[Subtemplate contains]
Current modules contain each other
【Use layout】
2. Create layout file Tpl/home/layout.html
Layout Grouping
home admin [tp framework cache usage]
Cache variable information (ordinary variables, arrays, objects), Most of our data is obtained from the mysql database. Cache media: memory (memcache), file (processing database), cache to database The data is stored in the database after optimization. Tp framework’s file cache (shortcut function): 1 You can set cache files to different directories to store
This can avoid storing too many cache files in one directory and affecting performance 2 Cache validity period
S(name, value, time); 4 Cache usage:
5 Cache deletion
6 Caching use cases
【System Variables】
Use all variables in the template $_GET $_POST $_SESSION $_COOKIE, etc. Get the configuration variable information config.php in the template Get configuration variable information in the controller 3. Do not use layout {__NOLAYOUT__}
a. Each group has its own configuration file config.php
b. Set the layout enable 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 static html content, cache part or all
a) Set S (name, value)
b) Read S (name)
c) Delete S (name, null) 3 Cache settings
Constant usage:
$Think.const.Constant name
$Think.get.Name
$Think.config.name
C (name); //Shortcut function
[Output literal tags as they are]