thinkphp Data Template display-system variables, constants, configuration files
Second, the system variable output
Normal template variables need to be assigned first to output in the template, but the system variables do not need to be directly in the template output, the output of system variables usually start with {$Think, eg:
{$Think. Server.script_name} Output $_server[' script_name '] variable {$Think. session.user_id} //Output $_session[' user_id '] variable {$Think. Get.pagenumber} //Output $_get[' pagenumber '] variable {$Think. cookie.name} //Output $_cookie[' name '] variable
Support Output $_server, $_env, $_post, $_get, $_request, $_sessioin and $_cookie variables
Three, constant output
1. System Constants
Output constants: {$Think. Const.module_name} or: {$Think. module_name}
? 2. Customize the constants in the controller and output
Controller: Const PAI = 3.14; $this->assign ("Pai", Self::P ai); $this->display (); Template: {$pai}
Iv. Configuration Output
First, there is a definition in the configuration file in which the output can be called directly in the template file
Output configuration parameters: {$Think. config.db_charset} {$Think. Config.url_model}
? ? Five, language output
Output language variable: {$Think. lang.page_error} {$Think. Lang.var_error}
?
?