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} take the first 3 characters in the header {$times|date='y-m-d h:i:s', # # #} converts times timestamp to date format==================================================use of the colon execution function: Output method and Execute return value {: U ('User/insert'} Example: {: Time ()} outputs the current date format and will be parsed into<?php echo Time ();?> ==================================================usage of wavy line function: Execute method without output {~function ()} example: {~SUBSTR ("aaaaaaa",3} does not output after execution, the back is parsed into <?php substr?> ============================================{$Think.Get. The get-over parameter in the URL} {$Think a variable in Server.server} {$Think the ID in session.session.|MD5} If you want, you can also MD5 the value {$Think. ID in Cookie.cookie}============={$Think. config.db_host} read configuration information in config {($title)? ($title):'No value currently'if the current parameter does not have a value, the following description is displayed================== <SwitchName=""> < CaseValue="1">aaaaaa</ Case> < CaseValue="2">bbbbbbbbb</ Case> <default/>No Data</Switch> =============== <eq name="a"Value="3">a equals 3<.Else/>a is not equal to 3</eq> <eq name="A|strlen"Value="1"The length of the >a is equal to 1<Else/>a length Not equal to 1</eq> ================= <inchName="a"Value="1,2,3,4"> variable a value at 1,2,3, print </in 4 rangeinch> <notin name="a"Value="1,2,3,4"> variable A value is not 1,2,3, print </notin> in 4 rangeor with<range name="a"Value="1,2,3,4"Type="inch">a in 1,2,3, 4 in range </range>//type to Notin is 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