k8凯发一触即发|Home

135-9299-6491
 
php模板smarty的一些简单技巧
日期:09-29 浏览次数:7

好久没有翻阅□□□□以前学习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
date_format:"%Y年%m月%d日"
assign var= value=
html_checkboxs name= values= checked= output= separator=
html_radios name= values= checke= output= separator=
html_select_date
if else /if
section name=xx loop=$news step=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进行咨询。

← 上一篇 下一篇 → 返回首页
如有意向,请联系我们的客户经理
我们会根据您的需求为你制定详细的解决方案
在线咨询 or 拨打业务热线:135-9299-6491
在线咨询
咨询在线客服
热线电话
解决方案
扫一扫

扫一扫
关注k8凯发一触即发

全国咨询热线
135-9299-6491

返回顶部