Template This is a more useful template, than smarty,fasttemplate and phplib template are easy to use
Chinese Text Archive Http://www.cqlc.net/cn_cqlctpl.txt
Here is the demo address: http://www.cqlc.net/web/tml.php
Please respect the author's labor results, the following 3 file download address: Http://www.cqlc.net/cqlctpl.zip
My homepage is: http://www.cqlc.net
1 Tags:
(1), variable: {$key} can be general variables, arrays and members of classes, but characters cannot be used ", only single quotes '
Example: {$value}, {$a [0]}, {$this->a[' color ']} It is wrong to write {$this->["color"}
(2), loop: {loop: Looping statement} other code {/loop} supports for and while loops
Example: {loop:for ($i =10 $i <=20; $i + +)} Test {$i} {/loop} output (test) 20~30 number
{loop:while ($i ++<10)} test {$a [$i]} {/loop} output (test) 20~30 Array
(3), logic: {logi: Conditional statement} other code {/logi} support If,elseif,else
Example: {logi:if ($i ==1)} test {$i} {/logi}
{Logi:elseif ($i ==2)} test {$a [$i]} {/logi}
{Logi:else} test {$a [$i]} {/logi}
(4), program: {EXEC: statement} program section, can be a function, note that characters can only be used ', not used '
Example: {exec: $a = ' hello '. $i} correct {exec: $a = "hello$i"} Error
{Exec:echo $a}
{Exec:echo time ()}
{exec: $this->outpage (1,2, ' index.php ')}
(5), {* Template annotation *} example: {* Here will not output *}
2, Template output:
Output only: eval (cqlctpl (template file)) Example: eval (cqlctpl ("1.tml"))
Set of templates: {Exec:eval (cqlctpl (template file))} Example: {Exec:eval (CQLCTPL ($Templatefile))}
{* Here is the other template file being dropped in the template *}
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.