简体   繁体   中英

Japid layout with different folder for Play 2.0

I have encounter japid layout problem with layout and html problem. For japid, if I have layout with loginlayout.html in Application folder. and my login.html in the Application folder too. 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. How do I import the loginLayout into Application folder.

Thanks ... I have google lots but most of the solution is support for Play version 1, its doesn't help on Play version 2.

Not sure if you have figure it out.

_layouts in Japid for Play 2 has been deprecated. You can import any directory to any templates by doing something like the following in the Global.java

import cn.bran.japid.template.JapidRenderer;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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