Thinkphp_ Template system Variable $think

Source: Internet
Author: User

System variable Output

Normal template variables need to be assigned before they can be 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 , for example:

 
   
  
  1. { $Think . Server . Script_name } //Output $_server[' script_name '] variable
  2. { $Think . session . user_id } //Output $_session[' user_id '] variable
  3. { $Think . Get . pagenumber } //Output $_get[' pagenumber '] variable
  4. { $Think . Cookie . name }   //Output $_cookie[' name '] variable

Supports output,,,,,, $_SERVER $_ENV $_POST $_GET $_REQUEST $_SESSION and $_COOKIE variables.

Constant output

You can also output constants

  
 
   
  
  1. {$Think.const.MODULE_NAME}

or directly using

  
 
   
  
  1. {$Think.MODULE_NAME}
Configuration output

The output configuration parameters are used:

  
 
   
  
  1. {$Think.config.db_charset}
  2. {$Think.config.url_model}
Language variables

Output language variables can be used:

  
 
   
  
  1. {$Think.lang.page_error}
  2. {$Think.lang.var_error}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.