JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > Control Tags > if
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  if
Added by scud, last edited by scud on May 10, 2006  (view change)
Labels: 
(None)

请确认你已经读过 Tag Syntax 文档并且已经理解标签的属性语法是如何工作的.

描述

基本的流程控制.'If'标签可单独使用也可以和'Else If'标签和(或)一个多个'Else'一起使用.

参数

名称 必填 缺省 类型 描述
test true   Boolean 决定If标签内容是否显示的表达式
id false   Object/String 所指元素的Id. 对于UI和form标签此Id就作为所对应的html标签的id属性

例子

<ww:if test="%{false}">
    <div>Will Not Be Executed</div>
 </ww:if>
	<ww:elseif test="%{true}">
    <div>Will Be Executed</div>
 </ww:elseif>
 <ww:else>
    <div>Will Not Be Executed</div>
 </ww:else>
Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators