如何在使用骨干网时从主页面隐藏模板(How to hide templates from the main page when working with backbone)

编程入门 行业动态 更新时间:2024-10-27 05:34:54
如何在使用骨干网时从主页面隐藏模板(How to hide templates from the main page when working with backbone)

我有一个家庭JSP页面。 我有一个家庭模板jsp页面。 现在我在主jsp中包含我的模板jsp页面,因此模板可以访问主干代码。

是否有可能我不必在主页中包含模板jsp页面,我可以在其他地方定义我的模板,但仍可从骨干代码访问。

I have a home JSP Page. I have a home template jsp page. Now i include my template jsp page inside the home jsp so the template are accessible for backbone code.

Is it possible i don't have to include the template jsp page in home page and i can define my template some other place but still accessible from backbone code.

最满意答案

您可以在项目中创建文件夹“template”,并在此文件夹中为每个模板创建一个不同的html文件。 在引导应用程序时,可以在内存中加载temlpate代码。 您仍然可以选择将所有模板放在一个文件中。 我不喜欢可读性。

看看这篇文章 。 这是一种组织模板的简洁方法,而且非常可维护!

You can create folder 'template' in your project and make a different html file in this folder for each template. You load the temlpate code in memory when you bootstrap your application. You can still choose to have all templates in one file. I prefer not to for readability.

Have a look at this article. It's a clean way to organize your templates and very mainainable!

更多推荐

本文发布于:2023-07-31 08:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1341940.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:骨干网   模板   如何在   主页   hide

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!