PHP page to the variable on smarty template (used here, create two variables on Smarty instead)
Copy CodeThe code is as follows:
{Assign var= "name" Value= ' Richard.lee '}
{Assign var= "age" value= ' 27 '}
1. Want to output at a location in the Smarty template (Richard.lee---27)
Stitching method: {$name |cat: "---" |cat: $age}
Explanation: Splicing variables $name, "---", $age into a string
2, want to output in a location of smarty template (name: Richard.lee, Age: 27), stitching method:
Copy CodeThe code is as follows:
{"Name:" |cat: $name |cat: ", Age:" |cat: $age}
{"Name:" |cat: $name |cat: "," |cat: "Age:" |cat: $age}
Explanation: Two stitching methods get the same effect
Note: The method found on the web is not very understanding |cat: the role, but after two simple examples to draw a simple conclusion: you can put |cat: as a link string symbol, equivalent to the point in the php file (.).
http://www.bkjia.com/PHPjc/825259.html www.bkjia.com true http://www.bkjia.com/PHPjc/825259.html techarticle the PHP page is uploaded to the variable on the Smarty template (here, create two variables on smarty) to copy the code as follows: {Assign var= "name" Value= ' Richard.lee '} {assign var= "age" V ...