良久没有翻阅之行学习php时间的资料,明天闲来无事掀开了下自身之行学习php的记实文档,发觉了一些可以和大家共享的武艺,主要都是
php模板smarty的一些庞大武艺,共享这些武艺希望对初学smarty的同志有所协助,可以不是太深邃的工具,可是希望大家都能学习下吧,会的总结总结,不会的学习学习。
下面是一些基于smarty庞大的使用案例和武艺总结列表。详细就纷歧行一行的和大家诠释了。
$smarty=new smarty()
$smarty->template_dir=
$smarty->complie_dir=
$smarty->cache_dir=
$smarty->left_delimiter=
$smarty->right_delimiter-
$smarty->caching=
$smarty->cache_lifetime=
$smarty->assign
$smarty->display
include file=""
cat:""
default:
indent:5:" "
replace:"author":"icyzhl"
lower:
capitalize
te_format:"%Y年%m月%d日"
assign var= value=
html_checkboxs name= values= checked= output= separator=
html_radios name= values= checke= output= separator=
html_select_te
if else /if
section name=xx loop=$news 步骤=1 start max show //$news[xx].
$smarty.section.xx.index
1. index: 上边咱们引见的"循环下标",默许为0
2. index_prev: 以后下标的前一个值,默许为-1
3. index_next: 以后下标的下一个值,默许为1
4. first: 是不是为第一下循环
5. last: 是不是为最终一个循环
6. iteration: 循环次数
7. rownum: 以后的行号,iteration的另外逐普通号
8. loop: 最终一个循环号,可用在section块后统计section的循环次数
9. total: 循环次数,可用在section块后统计循环次数
10. show: 在函数的声明中有它,用于判断section是不是显示
foreach from=$array item=xx //$xx.
foreachelse
/foreach
庞大说到这里吧,
徐州网络公司在这里谢谢您阅读至此,希望这些php_smarty武艺能帮上您。若是您还对smarty有任何疑问,也可以拨打咱们公司
网站建设询问德律风65322029中止询问。