The ThinkPHP template calls the session data method. There are many methods to call session data in the ThinkPHP framework template, which can be used flexibly as needed. The following are common methods: 1. directly call {$ Think in the template. session} There are many methods to call session data in the template for getting sessi ThinkPHP framework, which can be used flexibly as needed. The following are common methods:
1. call {$ Think. session} in the template to obtain the session;
2. in Tag directly write php code to call $ _ SESSION data;
3. write in the template <? Php?>, Then, directly write php code in it to call $ _ SESSION;
4. assign the $ _ SESSION variable to the template through The assign () method in the Action;
5. in the custom function library, create a new function to return the $ _ SESSION variable, then, use {$ variable life | function name} in the template file to assign $ _ SESSION returned by the function to a variable in the template.
In addition to the above five methods, readers can also develop new calling methods according to their preferences.
Sequence 1. in the template, call {$ Think. session} directly to obtain sessi...