天天看點

Coldfusion: customtag的一個用法之二。

有些時候,customtag裡的代碼也需要運作,就是不想顯示。這裡該一下上傳的那個codeblock程式來實作這個效果。

<cfparam name="attributes.output" default="1">

<cfif listfindnocase(attributes.codeid, attributes.currentcodeid) eq 0 and attributes.output eq "1">

     <cfexit>

</cfif>

<!--- 如果是end tag執行,執行這裡 --->

<cfif thistag.executionmode is "end" and attributes.output eq "0">

     <!--- 取消要顯示的内容 --->

     <cfset thistag.gemeratedcontent = "">

</cfif>

參考上次的文章: Coldfusion: customtag的一個用法。

繼續閱讀