Groovy&Grails-速查手册-Grails标签(Tags)

逻辑标签

标签名
描述
<g:if>
Logical switch based upon a test expression
<g:else>
The else portion of an if statement
<g:elseif>
The elseif portion of an if statement

迭代标签
标签名
描述
<g:while>
Executes a loop while a test condition is true
<g:each>
Iterates over a collection
<g:collect>
Iterates over a collection and transforms the results as defined in the expr parameter
<g:findAll>
Iterates over a collection where the elements match the GPath defined in the expr parameter
<g:grep>
Iterates over a collection where the elements match the filter defined in the expr parameter

分配标签

可以使用分配标签创建并赋值给一个变量

标签名
描述
<def> (deprecated)
Defines a variable to be used within the GSP page; use <set> instead
<set>
Sets the value of a variable used within the GSP page

链接标签
标签名
描述
<g:link>
Creates an HTML link using supplied parameters
<g:createLink>
Creates a link that you can use within other tags
<g:createLinkTo>
Creates a link to a directory or file


Ajax标签

标签名
描述
<g:remoteField>
Creates a text field that invokes a link when changed
<g:remoteFunction>
Creates a remote function that is called on a DOM event
<g:remoteLink>
Creates a link that calls a remote function
<g:formRemote>
Creates a form tag that executes an Ajax call to serialize the form elements
<g:javascript>
Includes JavaScript libraries and scripts
<g:submitToRemote>
Creates a button that executes an Ajax call to serialize the form elements

表单标签
标签名
描述
<g:actionSubmit>
Creates a submit button
<g:actionSubmitImage>
Creates a submit button using an image
<g:checkBox>
Creates a check box
<g:currencySelect>
Creates a select field containing currencies
<g:datePicker>
Creates a configurable date picker for the day, month, year, hour, minute, and second
<g:form>
Creates a form
<g:hiddenField>
Creates a hidden field
<g:localeSelect>
Creates a select field containing locales
<g:radio>
Creates a radio button
<g:radioGroup>
Creates a radio button group
<g:select>
Creates a select/combo box field
<g:textField>
Creates a text field
<g:textArea>
Creates a text area field
<g:timeZoneSelect>
Creates a select field containing time zones

UI标签

标签名
描述
<g:richTextEditor>
Creates a rich text editor, which defaults to fckeditor

渲染和布局标签

标签名
描述
<g:applyLayout>
Applies a layout to a body or template
<g:encodeAs>
Applies dynamic encoding to a block of HTML to bulk-encode the content
<g:formatDate>
Applies a SimpleDateFormat to a date
<g:formatNumber>
Applies a DecimalFormat to number
<g:layoutHead>
Displays a decorated page’s header, which is used in layouts
<g:layoutBody>
Displays a decorated page’s body, which is used in layouts
<g:layoutTitle>
Displays a decorated page’s title, which is used in layouts
<g:meta>
Displays application metadata properties
<g:render>
Displays a model using a template
<g:renderErrors>
Displays errors
<g:pageProperty>
Displays a property from a decorated page
<g:paginate>
Displays Next/Previous buttons and breadcrumbs for large results
<g:sortableColumn>
Displays a sortable table column

验证标签
标签名
描述
<g:eachError>
Iterates through errors
<g:hasErrors>
Checks if errors exist within the bean, model, or request
<g:message>
Displays a message
<g:fieldValue>
Displays the value of a field for a bean that has data binding

转载于:https://my.oschina.net/65304586/blog/165737

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值