简体   繁体   English

用于Play 2.0的具有不同文件夹的Japid布局

[英]Japid layout with different folder for Play 2.0

I have encounter japid layout problem with layout and html problem. 我遇到了布局和html问题的简单布局问题。 For japid, if I have layout with loginlayout.html in Application folder. 对于japid,如果我在Application文件夹中使用loginlayout.html进行布局。 and my login.html in the Application folder too. 和我的login.html也在Application文件夹中 Therefore my code will like below: 因此,我的代码如下所示:

@extends loginLayout("Login")
<h1>Testing</h1>

something like this. 这样的事情。 These will not have any problem if both of them are in the same folder. 如果它们都在同一个文件夹中,这些将没有任何问题。 If I put the loginlayout.html in the _layout folder, and my login.html is in Applicaiton folder. 如果我将loginlayout.html放在_layout文件夹中,而我的login.html在Applicaiton文件夹中。 How do I import the loginLayout into Application folder. 如何将loginLayout导入到Application文件夹中。

Thanks ... I have google lots but most of the solution is support for Play version 1, its doesn't help on Play version 2. 谢谢...我有很多谷歌,但大多数解决方案是对Play版本1的支持,但对Play版本2没有帮助。

Not sure if you have figure it out. 不确定是否已解决。

_layouts in Japid for Play 2 has been deprecated. Japid for Play 2中的_layouts已被弃用。 You can import any directory to any templates by doing something like the following in the Global.java 您可以通过在Global.java中执行以下操作将任何目录导入任何模板

import cn.bran.japid.template.JapidRenderer;

public class Global extends JapidRenderer {
    @Override
    public void onStartJapid() {
        addImport("japidviews._layouts.*");
        addImport("japidviews._tags.*");
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM