|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.grails.web.taglib.LayoutWriterStack
public class LayoutWriterStack extends java.lang.Object
Class that can be used by "layout" tags, i.e. tags that use the different parts in their body to assemble a bigger part. Example a threeColumn tag that expects a left, center and right part in its body and places them in a table:
left contents middle contents right contents
Method Summary | |
---|---|
static java.io.Writer
|
currentWriter(java.lang.String name)
Returns a java.io.Writer where a layout part can write its contents to. |
static java.util.Map
|
writeParts(groovy.lang.Closure body)
Executes the body closure of a tag and returns a Map with namned results that hold the content of the parts within the body. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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() |
Method Detail |
---|
public static java.io.Writer currentWriter(java.lang.String name)
def left = { attrs, body -> LayoutWriterStack.currentWriter('left') << "" << body() <<"" }
name
- Name of the layout part
public static java.util.Map writeParts(groovy.lang.Closure body)
def parts = LayoutWriterStack.writeParts(body) out << "left part:" << parts.left << "; right part:" << parts.right << ";remainder of body:" << parts.body
body
- the body closure of the calling "layout" tag
Groovy Documentation