layoutTitle
用途
用于布局输出标题标记的内容装饰页。.相当于SiteMesh
<decorator:title />标记
示例
修饰页面的例子:
<html>
<head>
<title><g:layoutTitle default="Some Title" /></title>
<script src="global.js" />
<g:layoutHead />
</head>
<body><g:layoutBody /></body>
</html>
结果:
<html>
<head>
<title>Hello World!</title>
<script src="global.js" />
<script src="myscript.js" />
</head>
<body>Page to be decorated</body>
</html>
来源
Show
Source
def layoutTitle = { attrs ->
String title = page.title
if (!title && attrs.'default') title = attrs.'default'
if (title) out << title;
}