欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

smarty內(nèi)置函數(shù)capture用法分析

 更新時(shí)間:2015年01月22日 11:59:54   投稿:shichen2014  
這篇文章主要介紹了smarty內(nèi)置函數(shù)capture用法,實(shí)例分析了capture的三種常見用法,需要的朋友可以參考下

本文實(shí)例講述了smarty內(nèi)置函數(shù)capture用法。分享給大家供大家參考。具體分析如下:

{capture}可以捕獲標(biāo)記范圍內(nèi)的輸出內(nèi)容,并存到變量中而不顯示。有三種用法,
代碼如下:

復(fù)制代碼 代碼如下:
{capture name="banner"}aaaaaa{/capture}
{$smarty.capture.banner}
<hr />
{capture assign="foo"}bbbbbb{/capture}
{$foo}
<hr />
{capture append="arr"}hello{/capture}
{capture append="arr"}world{/capture}
{foreach $arr as $value}
{$value}
{/foreach}

第一種:{capture}使用name屬性;
第二種:{capture}捕獲內(nèi)容到變量;
第三種:{capture}捕獲內(nèi)容到數(shù)組變量。

希望本文所述對(duì)大家的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論