Original: thinkphp template Call function method
{variable | function 1| function 2| function 3 = parameter 1, parameter 2, parameter 3,###}
# # #为第4个参数, replace the variable with the 4th parameter
Example:
{$username |substr=0,3} takes the first 3 characters in the header
{$times |date= ' y-m-d h:i:s ', # # #} convert times timestamp to date format
==================================================
Use of the colon execution function: Output method and execute return value
{: U (' User/insert ')}
Example:
{: Time ()} will output the current date format and will be parsed into <?php echo time ();?>
==================================================
Usage of wavy Line function: Execute method but not output
{~function ()}
Example:
{~substr ("Aaaaaaa", 3)} does not output after execution, the back is parsed into <?php substr?>
============================================
{$Think The Get-over parameter in Get.url}
{$Think a variable in Server.server}
{$Think. Session.session in Id|md5} You can MD5 the value if you want.
{$Think. ID in Cookie.cookie}
=============
{$Think. config.db_host} read configuration information in config
{($title)? ($title): ' No value currently '} If no value is present, the following description is displayed
==================
<switch name= "" >
<case value= "1" >aaaaaa</case>
<case value= "2" >bbbbbbbbb</case>
<default/> No data
</switch>
===============
<eq name= "A" value= "3" >a equals 3<else/>a not equal to 3</eq>
<eq name= "A|strlen" value= "1" >a length equals 1<else/>a length not equal to 1</eq>
=================
<in name= "A" value= "1,2,3,4" > variable a value printed in 1,2,3,4 range </in>
<notin name= "A" value= "1,2,3,4" > variable a value does not print in 1,2,3,4 range </notin>
or with
<range name= "A" value= "1,2,3,4" type= "in" >a within 1,2,3,4 range </range>//type to notin or not, this method can replace in and Notin
===============
<empty name= "A" >a variable is empty </empty>
<notempty name= "A" >a variable is not empty </notempty>
Thinkphp Template Call Function method