合肥網(wǎng)站建設(shè)
文章閱讀
網(wǎng)建技巧
優(yōu)化技巧
網(wǎng)建問題
謹(jǐn)宸新聞
行業(yè)新聞

首頁 > 合肥網(wǎng)站建設(shè) > 正文

php模板smarty的一些簡(jiǎn)單技巧

發(fā)布時(shí)間:2011/08/24字體:
摘要:php模板smarty的一些簡(jiǎn)單技巧,smarty初學(xué)者簡(jiǎn)單技巧,今天突然打開電腦看看以前學(xué)習(xí)smarty的時(shí)候總結(jié)的一些簡(jiǎn)單的技巧,希望對(duì)php初學(xué)者有些幫助,可能都是一些簡(jiǎn)單的技巧,應(yīng)該是有用的總結(jié)。
好久沒有翻閱以前學(xué)習(xí)php時(shí)候的資料,今天閑來無事打開了下自己以前學(xué)習(xí)php的記錄文檔,發(fā)現(xiàn)了一些可以和大家分享的技巧,主要都是php模板smarty的一些簡(jiǎn)單技巧,分享這些技巧希望對(duì)初學(xué)smarty的同志有所幫助,可能不是太高深的東西,但是希望大家都能學(xué)習(xí)下吧,會(huì)的總結(jié)總結(jié),不會(huì)的學(xué)習(xí)學(xué)習(xí)。

下面是一些基于smarty簡(jiǎn)單的使用方法和技巧總結(jié)列表。具體就不一行一行的和大家解釋了。

$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: 上邊我們介紹的"循環(huán)下標(biāo)",默認(rèn)為0
2. index_prev: 當(dāng)前下標(biāo)的前一個(gè)值,默認(rèn)為-1
3. index_next: 當(dāng)前下標(biāo)的下一個(gè)值,默認(rèn)為1
4. first: 是否為第一下循環(huán)
5. last: 是否為最后一個(gè)循環(huán)
6. iteration: 循環(huán)次數(shù)
7. rownum: 當(dāng)前的行號(hào),iteration的另一個(gè)別名
8. loop: 最后一個(gè)循環(huán)號(hào),可用在section塊后統(tǒng)計(jì)section的循環(huán)次數(shù)
9. total: 循環(huán)次數(shù),可用在section塊后統(tǒng)計(jì)循環(huán)次數(shù)
10. show: 在函數(shù)的聲明中有它,用于判斷section是否顯示


foreach from=$array item=xx //$xx.
foreachelse
/foreach

簡(jiǎn)單說到這里吧,合肥網(wǎng)絡(luò)公司在這里感謝您閱讀至此,希望這些php_smarty技巧能幫上您。如果您還對(duì)smarty有任何疑問,也可以撥打我們公司網(wǎng)站建設(shè)咨詢電話65322029進(jìn)行咨詢。
本文標(biāo)題:php模板smarty的一些簡(jiǎn)單技巧
本文網(wǎng)址:http://newport-shores.com/wangjianjiqiao/369.html
原創(chuàng)網(wǎng)址:合肥網(wǎng)絡(luò)公司<謹(jǐn)宸科技> 版權(quán)所有,轉(zhuǎn)載請(qǐng)注明出處,并以鏈接形式鏈接網(wǎng)址:newport-shores.com
文章標(biāo)簽:phpsmarty技巧簡(jiǎn)單
 上一篇:謹(jǐn)宸簽約合肥永升安全防范公司
 下一篇:谷歌pr值預(yù)測(cè)準(zhǔn)嗎?