- 1、本文档共9页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
smarty(Smarty)
smarty(Smarty)
#smarty notes
{* notes *}
#smarty assignments to the variables
In the end of 1. PHP distribution variable value
2. in the template for variable assignment
{$name2= Zhao Tong}
Direct calculation of the variable #smarty
Can be calculated directly in the template, the calculation results from the template output directly. But the calculation results if the assignment, not in direct output page.
hr/
{$n=10}
{$b=20}
{$c=$n+$b} / / not output
{$c} / / 30 output
The output of the array #smarty
1.php end
$smarty-assign (c, array ( Diao Chan , beauty , Yang Yuhuan , Zhao Tongzheng ));
$smarty-assign (d, array (nice= Joe , Joe = Taylor));
The 2. end of the template
{$c[3]}
{$d[nice]}
{$d.nice}
Analysis of variables in the #smarty string
With ` ` reverse Quotes
{$nice=lotus, Xifeng, Zhao Tongzheng}
{North beauty, Gu Qingren City, again Gu Qingren country, regardless of beauty and fashion, beauty finds it difficult to get the kind of person is `$nice`sm}
The use of #smarty branch structure (built-in function manual part)
{if $sex==female}
Src=./girl.jpg/ img
{else}
Src=./boy.bmp/ img
{/if}
=========================================================
{if $sex==female}
Src=./girl.jpg/ img
{else if $sex==} male
Src=./boy.bmp/ img
{else}
img src=./maomi.png/
{/if}
============================================================
{if $n is even}
{$n} is even
{else}
{$n} is odd
{/if}
==========================================================
{if $sex==male}
body bgColor=blue
{else}
body bgColor=red
{/if}
#smarty using the loop structure
{for $i=0 to 2}
The value of pi is {$i}/p
{/for}
======================================================
table width=800border=1
{for $i=0 to 9 step 2}
trtd{$i}/td/tr
{/for}
/table
==========================================================
table width=800border=1
{for $i=9 to 0 step -1}
trtd{$i}/td/tr
{/for}
/table
========================================================
table width=800border=1
{for $i=9 to 0 step 1}
trtd{$i}/td/tr
{forelse}
trt
您可能关注的文档
- plc与编码器的应用(The application of PLC and encoder).doc
- plc在棉纺细纱机电气控制系统的应用(Application of PLC in electric control system of cotton spinning frame).doc
- plc干扰(PLC interference).doc
- pom材料特性(pom材料特性).doc
- powerpc 常用寄存器简介(Introduction to PowerPC common registers).doc
- powerpoint 2003题库版5第五章插入及编辑表格和图表b(PowerPoint 2003 question library version 5, fifth chapters insert and edit tables and charts B).doc
- policy route(策略路由).doc
- powerpoint实用技巧荟萃(PowerPoint practical skills).doc
- plc学习建议(PLC learning tips).doc
- ppp模式的风险分析与对策(Risk analysis and Countermeasure of PPP model).doc
- 编制说明-征求意见稿-黄花景天栽培技术规程.docx
- TNJ 1345-饲草揉碎机可靠性校核方法-征求意见稿.docx
- TNJ1236-生猪养殖场车辆洗消成套设备【征求意见稿】.docx
- TNJ1267-联合收割机远程运维云服务平台 架构与功能-征求意见稿.docx
- TNJ1371-棉花打包膜【征求意见稿】.docx
- 百合熟料机团体标准编制说明(征求意见稿).docx
- 《黄花景天栽培技术规程》编制说明.pdf
- TNJ1350-花生收获机械捡拾装置【征求意见稿】.docx
- TNJ1366-草原改良机械草原切根施肥播种联合作业机【征求意见稿】.docx
- TNJ1344-桑茶机械化加工技术规程团体标准-征求意见稿.docx
文档评论(0)