one, variable output
1. Scalar output (normal)
2. Array output
{$name [1]}
{$name [' K2 ']}
{$name. K1}
$arr = Array (' a1 ' = ' and ' appropriate ', ' a2 ' = ' comfort point ');
$this->assign ($arr); Pass the entire array directly without assigning values, using the array's subscript as the name directly in the template
<{$a 1}>//= and can be properly
3. Object output
How to introduce a third-party class file
New folder under 1.www\think\thinkphp\extend\library\org folder Test
2. New Test.class.php
3.import (' ORG. Test.test ');
4.new Test
$obj = new Test ();
$this->assign (' obj ', $obj);
{$obj: k}
{$obj->k}
second, System variablesCookie session Get ... Manual, template engine, System variables
{$Think. Get.id}
iii. use of functions
{$name |strtoupper} generated the compiled file is <?php Echo (Strtoupper ($name));?>
{$name |date= ' Y m D h:i:s ', # # #}
Four, default value
{$name |default= ' here is the default value '}
v. Operators
+ - * / % ++ --
{$name + +}
Use of variables in thinkphp templates