类 LayoutTag

java.lang.Object
org.beetl.core.tag.Tag
org.beetl.ext.tag.LayoutTag

public class LayoutTag extends Tag
提供一个布局功能,每个页面总是由一定布局,如页面头,菜单,页面脚,以及正文 layout标签允许为正文指定一个布局,如下使用方式

content.html内容如下:

 <%layout("/org/bee/tl/samples/layout.html"){%>
    this is 正文
    ..........
    <%}%>
 
layout.html 是布局文件,内容如下·
 this is header
    this is content:${layoutContent}
    this is footer:
 

运行content.html模板文件后,,正文文件的内容将被替换到layoutContent的地方,变成如下内容

 this is header
    this is content:this is 正文
    ............
    this is footer:
 
如果向布局传入参数,则可以使用这种格式

layout(path,{'paraName1':value1,'paraName2',value2}) 如果变量layoutContent与模板有冲突,可以作为第三个参数传入到layout变量里,如: layout(path,{},"xxxLayoutContent");
从以下版本开始:
2.0
作者:
xiandafu
  • 字段详细资料

    • defaultLayoutName

      public static String defaultLayoutName
  • 构造器详细资料

    • LayoutTag

      public LayoutTag()
  • 方法详细资料

    • render

      public void render()
      指定者:
      render 在类中 Tag
    • getRelResourceId

      protected Object getRelResourceId()