First, the use of templates (emphasis)
A, rules
Under Templates folder [tpl]/[Group folder/][template theme Folder/] folder with the same name as module name [index]/and method name file [Index].html (. TPL)
Replace the suffix name of the template file (modify config file) ' Tmpl_template_suffix ' + '. html ',//change template file suffix name
b, modify the template file directory hierarchy ' Tmpl_file_depr ' = ' _ ',//Modify the template file directory hierarchy
C, template theme ' Default_theme ' + ' your ',//Set Default template theme you need to create a new your folder under the TPL as a template theme folder
How do I dynamically modify a template theme?
1. Prepare a function in the background, modify the default template item in the config.php file
2, through the URL pass t= theme parameter can modify different template ' default_theme ' = ' your ',//Set the default template theme ' Tmpl_detect_theme ' =>true,//auto-detect template theme ' theme_l IST ' = ' your,my ',//list of supported template themes
Ii. Output template content (emphasis)
A, display
1.display No Parameters $this->display ();
2. Can take the parameter $this->display (other template files under this module folder); $this->display (' index2 ');
$this->display (template file under other folders); $this->display (' public:error ');///Note that you only need to have the public folder under the TPL and the error.html in it, there is no need to have the public module
$this->display (template file under other subject folder);//need to turn on theme support $this->display (' My:Index:index ');
Thinkphp Study 11