是否可以在Sitemesh中进行多次装饰? [英] Is it possible to decorate more than once in Sitemesh?

查看:94
本文介绍了是否可以在Sitemesh中进行多次装饰?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行以下操作:

I'm trying to do something like this:

对于对/admin/*的所有请求,我需要使用B装饰器装饰页面,而且B装饰器必须包含在A装饰器的内容中,该装饰器是主应用程序布局.

For all the requests to /admin/* I need the page to be decorated using the B decorator but also that B decorator has to be included in the content of A decorator which is main application layout.

我该如何使用Sitemesh?

How can I do that with Sitemesh?

有可能吗?还是我必须在B装饰器中从A重复相同的布局?

Is it even possible? Or do I have to repeat the same layout from A in the B decorator?

预先感谢

推荐答案

回答我自己的问题.是的,有可能:

To answer my own question. Yes it is possible:

使用我自己的示例,这是装饰器 b 由装饰器 a 装饰.

Using my own example, this is decorator b being decorated by decorator a.

<page:applyDecorator name="a">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Decorator B</title>
    <decorator:head/>
</head>
<body id="page-home">
    This is a test.
</body>
</html>
</page:applyDecorator>

这篇关于是否可以在Sitemesh中进行多次装饰?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆