[coldfusion] custom tag paried 与empty的区别

呵呵 我大概知道那个paried和 empty的关系了。
呵呵 我测试了一下

<!---Text.cfm  as a custom tag--->
Inside the custom tag<br>
cfoutput>
 nihao !
 #ucase(thistag.generatedcontent)#
</cfoutput><br>

<!---end--->


//


<!--- CFText.cfm as a call custom tag --->
<cf_text>
Between the pair<br>
</cf_text>


<!---end--->


假如没有</cf_text> 即为 empty时候
那么就会输出
Inside the custom tag
nihao !
Between the pair


而有</cf_text> 即为 paired时候
则会输出
Inside the custom tag
nihao !
Between the pair
Inside the custom tag
nihao ! BETWEEN THE PAIR


那么就是说明 当是empty的时候它执行一次且thistag.generatedcontent为空,这个为paired函数,还有就是它拥有 start mode,没有end mode
<cfif ThisTag.ExecutionMode EQ "start">
这样的可以执行
比如
<cfif ThisTag.ExecutionMode EQ "start">
Inside the custom tag<br>
<cfoutput>
 nihao !
 #ucase(thistag.generatedcontent)#

</cfoutput><br>
</cfif>

只是它对于没有</cf_text> 即为 empty时候 #ucase(thistag.generatedcontent)# 输出为空,即只有start mode模式的证明。


而对于有</cf_text> 即为 paired时候 在没有 mode (start,end)的条件判断的时候,它是执行两次的,也许这也是为什那么判断mode(start,end)的原因了.
还有就是看了 nested custom tag 感觉到这个paired有递归的作用,有进有出。

呵呵 暂时了解也就这么多,呵呵 大概是理解到这么程度了,我不知道对不对 只是自己的理解。
呵呵

 

 


如果想知道很清楚 http://coldfusion.sys-con.com/node/41856有很详细的说明

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值