Package: org.codehaus.groovy.grails.plugins.web.taglib

## [Groovy] Class RenderTagLib

- org.codehaus.groovy.grails.plugins.web.taglib.RenderTagLib

- All Implemented Interfaces and Traits:
    com.opensymphony.module.sitemesh.RequestConstants

      @groovy.transform.CompileStatic
      @Artefact("TagLibrary")
      class RenderTagLib
      extends java.lang.Object

  Tags to help rendering of views and layouts.

  Authors:
    Graeme Rocher

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `groovy.lang.Closure` | `applyLayout` Apply a layout to a particular block of text or to the given view or template.
    `CodecLookup` | `codecLookup`
    `ErrorsViewStackTracePrinter` | `errorsViewStackTracePrinter`
    `GroovyPageLayoutFinder` | `groovyPageLayoutFinder`
    `GroovyPagesTemplateEngine` | `groovyPagesTemplateEngine`
    `GroovyPagesTemplateRenderer` | `groovyPagesTemplateRenderer`
    `TagLibraryLookup` | `gspTagLibraryLookup`
    `groovy.lang.Closure` | `ifPageProperty` Invokes the body of this tag if the page property exists:
    `groovy.lang.Closure` | `layoutBody` Used in layouts to render the body of a SiteMesh layout.
    `groovy.lang.Closure` | `layoutHead` Used in layouts to render the head of a SiteMesh layout.
    `groovy.lang.Closure` | `layoutTitle` Used in layouts to render the page title from the SiteMesh page.
    `groovy.lang.Closure` | `pageProperty` Used to retrieve a property of the decorated page.
    `groovy.lang.Closure` | `render` Renders a template inside views for collections, models and beans.
    `groovy.lang.Closure` | `renderException` Renders an exception for the errors view

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected com.opensymphony.module.sitemesh.PageParser` | `createPageParser(java.lang.String contentType)`
    `protected com.opensymphony.module.sitemesh.Decorator` | `findDecorator(javax.servlet.http.HttpServletRequest req, java.lang.String layoutName)`
    `protected groovy.text.Template` | `findTemplate(com.opensymphony.module.sitemesh.Decorator decorator)`
    `protected com.opensymphony.module.sitemesh.parser.AbstractHTMLPage` | `getPage()`
    `protected groovy.util.Factory` | `getSitemeshFactory()`
    `protected boolean` | `isSitemeshPreprocessMode()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Property Detail

    - #### groovy.lang.Closure applyLayout

      Apply a layout to a particular block of text or to the given view or template.
      <g:applyLayout name="myLayout">some text</g:applyLayout>
      <g:applyLayout name="myLayout" template="mytemplate" />
      <g:applyLayout name="myLayout" url="http://www.google.com" />
      <g:applyLayout name="myLayout" action="myAction" controller="myController">

      attr:
        name The name of the layout
      attr:
        template Optional. The template to apply the layout to
      attr:
        url Optional. The URL to retrieve the content from and apply a layout to
      attr:
        action Optional. The action to be called to generate the content to apply the layout to
      attr:
        controller Optional. The controller that contains the action that will generate the content to apply the layout to
      attr:
        contentType Optional. The content type to use, default is "text/html"
      attr:
        encoding Optional. The encoding to use
      attr:
        params Optional. The params to pass onto the page object
      attr:
        parse Optional. If true, Sitemesh parser will always be used to parse the content.

    - #### CodecLookup codecLookup

    - #### ErrorsViewStackTracePrinter errorsViewStackTracePrinter

    - #### GroovyPageLayoutFinder groovyPageLayoutFinder

    - #### GroovyPagesTemplateEngine groovyPagesTemplateEngine

    - #### GroovyPagesTemplateRenderer groovyPagesTemplateRenderer

    - #### TagLibraryLookup gspTagLibraryLookup

    - #### groovy.lang.Closure ifPageProperty

      Invokes the body of this tag if the page property exists:
      <g:ifPageProperty name="meta.index">body to invoke</g:ifPageProperty>
      or it equals a certain value:
      <g:ifPageProperty name="meta.index" equals="blah">body to invoke</g:ifPageProperty>

      attr:
        name REQUIRED the property name
      attr:
        equals optional value to test against

    - #### groovy.lang.Closure layoutBody

      Used in layouts to render the body of a SiteMesh layout.
      <g:layoutBody />

      emptyTag:

    - #### groovy.lang.Closure layoutHead

      Used in layouts to render the head of a SiteMesh layout.
      <g:layoutHead />

      emptyTag:

    - #### groovy.lang.Closure layoutTitle

      Used in layouts to render the page title from the SiteMesh page.
      <g:layoutTitle default="The Default title" />

      emptyTag:
        @attr default the value to use if the title isn't specified in the GSP

    - #### groovy.lang.Closure pageProperty

      Used to retrieve a property of the decorated page.
      <g:pageProperty default="defaultValue" name="body.onload" />

      emptyTag:
        @attr REQUIRED name the property name
      attr:
        default the default value to use if the property is null
      attr:
        writeEntireProperty if true, writes the property in the form 'foo = "bar"', otherwise renders 'bar'

    - #### groovy.lang.Closure render

      Renders a template inside views for collections, models and beans. Examples:
      <g:render template="atemplate" collection="${users}" />
      <g:render template="atemplate" model="[user:user,company:company]" />
      <g:render template="atemplate" bean="${user}" />

      attr:
        template REQUIRED The name of the template to apply
      attr:
        contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template.
      attr:
        bean The bean to apply the template against
      attr:
        model The model to apply the template against as a java.util.Map
      attr:
        collection A collection of model objects to apply the template to
      attr:
        var The variable name of the bean to be referenced in the template
      attr:
        plugin The plugin to look for the template in

    - #### groovy.lang.Closure renderException

      Renders an exception for the errors view

      attr:
        exception REQUIRED The exception to render

  - ### Method Detail

    - #### protected com.opensymphony.module.sitemesh.PageParser createPageParser(java.lang.String contentType)

    - #### protected com.opensymphony.module.sitemesh.Decorator findDecorator(javax.servlet.http.HttpServletRequest req, java.lang.String layoutName)

    - #### protected groovy.text.Template findTemplate(com.opensymphony.module.sitemesh.Decorator decorator)

    - #### protected com.opensymphony.module.sitemesh.parser.AbstractHTMLPage getPage()

    - #### protected groovy.util.Factory getSitemeshFactory()

    - #### protected boolean isSitemeshPreprocessMode()