smarty內(nèi)置函數(shù){loteral}、{ldelim}和{rdelim}用法實(shí)例
更新時間:2015年01月22日 11:42:31 投稿:shichen2014
這篇文章主要介紹了smarty內(nèi)置函數(shù){loteral}、{ldelim}和{rdelim}用法,實(shí)例分析了{(lán)loteral}、{ldelim}和{rdelim}的功能及使用技巧,需要的朋友可以參考下
本文實(shí)例講述了smarty內(nèi)置函數(shù){loteral}、{ldelim}和{rdelim}用法。分享給大家供大家參考。具體如下:
{ldelim}和{rdelim}分別是smarty標(biāo)識的左分隔符和右分隔符。如下面的javascript代碼可以這么使用。
模板文件temp.htm如下:
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
function myfunction(){ldelim}
alert("aaaaaa");
{rdelim}
</script>
<a href="#" onclick="javascript:myfunction()">aaaa</a>
function myfunction(){ldelim}
alert("aaaaaa");
{rdelim}
</script>
<a href="#" onclick="javascript:myfunction()">aaaa</a>
{literal}內(nèi)容區(qū)域{/liteal},可以將“內(nèi)容區(qū)域”按原樣輸出,而smarty不會對其解析。如上面的代碼可改成:
復(fù)制代碼 代碼如下:
<script language="javascript" type="text/javascript">
{literal}
function myfunction(){
alert("aaaaaa");
}
{/literal}
</script>
<a href="#" onclick="javascript:myfunction()">aaaa</a>
{literal}
function myfunction(){
alert("aaaaaa");
}
{/literal}
</script>
<a href="#" onclick="javascript:myfunction()">aaaa</a>
希望本文所述對大家的php程序設(shè)計有所幫助。
相關(guān)文章
學(xué)習(xí)php設(shè)計模式 php實(shí)現(xiàn)享元模式(flyweight)
這篇文章主要介紹了php設(shè)計模式中的享元模式,使用php實(shí)現(xiàn)享元模式,感興趣的小伙伴們可以參考一下2015-12-12
php之使用docker運(yùn)行workerman案例講解
這篇文章主要介紹了php之使用docker運(yùn)行workerman案例講解,本篇文章通過簡要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-08-08
php include的妙用,實(shí)現(xiàn)路徑加密
用這種方法比較繁瑣,只能隱藏后臺腳本的路徑,前端的腳本路徑仍然可以在源文件中看得到(baseref) 在地址欄上看到的地址都是index.php?xxxxxxxx2008-07-07

