I started learning ASP.NET MVC3.
我开始学习ASP。净MVC3。
So, while reading tutorials online and in books, I came across this term "view engine" quite frequently. I don't know what it is.
所以,当我在网上和书本上阅读教程的时候,我经常遇到这个术语“视图引擎”。我不知道是什么。
What does it actually do?
它到底是做什么的?
Why should it matter to me at all?
这对我有什么意义呢?
10 个解决方案
#1
43
The view engine is responsible for creating HTML from your views. Views are usually some kind of mixup of HTML and a programming language. The pattern behind most of these is called two-step view.
视图引擎负责从视图创建HTML。视图通常是HTML和编程语言的混合体。其中大部分的模式称为两步视图。
For example, ASP.NET comes with its own view engine out of the box. That is the one where views have lots of tags like <% %>
and <%: %>
. It uses the .aspx
file extension.
例如,ASP。NET自带了自己的视图引擎。视图中有很多标签,比如<% >和<%:%>。它使用.aspx文件扩展名。
With ASP.NET MVC3, another out-of-the-box view engine was added, Razor, which has a more appealing syntax, e.g. <div>@Model.UserName</div>
.
ASP。NET MVC3是另一个开箱即用的视图引擎,Razor具有更吸引人的语法,比如
The choice of view engine is important, because the feature sets of view engines are quite different. Some support rendering to PDF files, for instance; some can't be used outside a web context (this is true for the old ASP.NET view engine), while others can (e.g. Razor). 'Offline' rendering of views comes in handy when you want to create HTML emails the same way you build your views and those emails should be sent from a background worker rather than a web application.
视图引擎的选择很重要,因为视图引擎的特性集是完全不同的。例如,一些支持对PDF文件的呈现;有些不能在web上下文之外使用(这对于旧的ASP是正确的。NET视图引擎),而其他人可以(如Razor)。当你想创建HTML电子邮件时,“离线”的视图呈现非常有用,就像你构建视图的方式一样,这些电子邮件应该从后台工作人员而不是web应用程序发送。
There's a nice comparison of asp.net view engines here on SO.
这里有一个很好的asp.net视图引擎的比较。
The good news is that you can use multiple view engines in parallel in ASP.NET MVC, though I wouldn't recommend it unless necessary.
好消息是您可以在ASP中并行地使用多个视图引擎。NET MVC,除非必要,我不会推荐它。
There are some very nice extension points in the Razor engine already. For example, you can provide a custom view base class, a powerful concept that makes it easy to add a lot of functionality in the right place without having to mess with all the gritty details that you'd have to cope with otherwise.
剃须刀引擎已经有了一些很好的扩展点。例如,您可以提供一个自定义视图基类,这是一个强大的概念,它使您可以轻松地在正确的位置添加大量的功能,而不必处理您必须处理的所有棘手的细节。
I'd currently go for Razor.
我现在喜欢剃刀。
#2
7
The view engine is what's responsible for rendering your view, and converting your code into glorious HTML. As such, they are directly responsible for HOW you need to write code in your views.
视图引擎负责呈现视图,并将代码转换为漂亮的HTML。因此,它们直接负责如何在视图中编写代码。
There's basically two ones you need to care about: ASPX and Razor. Razor is, in my opinion, much sleeker and easier to use, at the cost of only being supported in MVC3.
基本上有两个你需要关注的:ASPX和Razor。在我看来,Razor更圆滑、更容易使用,只需要在MVC3中支持就可以了。
For example, a code block in ASPX might look like this:
例如,ASPX中的代码块可能如下所示:
<% foreach(var item in Model) { %>
<tr>
<td><%: item.Name %></td>
</tr>
<% } %>
Whereas the Razor equivalent will look like this:
而剃刀的等价物是这样的:
@foreach(var item in Model) {
<tr>
<td>@item.Name</td>
</tr>
}
#3
2
A view engine is what MVC uses to find and render the views you are requesting from the controller. If you are satisfied with the default routing you probably wont need to change anything, but lets say you wanted to have your shared files usually located in root/views/shared to instead be located in root/common, a custom viewengine is what you will need to create to be able to do that.
视图引擎是MVC用来查找和呈现从控制器请求的视图的。如果你满意默认路由可能不会需要改变什么,但假设你想要共享的文件通常位于根/视图/共享而不是位于根/常见,你需要创建自定义viewengine能够这样做。
Here you can see how to build a viewengine:
在这里,您可以看到如何构建一个视图引擎:
http://coderjournal.com/2009/05/creating-your-first-mvc-viewengine/
http://coderjournal.com/2009/05/creating-your-first-mvc-viewengine/
The view engine is also responsible for rendering the view, but as you are just learning MVC you will probably not need to alter the rendering functionality just yet
视图引擎也负责呈现视图,但由于您只是学习MVC,您可能还不需要修改呈现功能。
#4
2
In MVC, View engine is the one that works between your View and browser to provide valid HTML output to your browser by compiling the code inside your View. There are many view engines available and some of them are following:
在MVC中,视图引擎是在视图和浏览器之间工作的,它通过编译视图中的代码向浏览器提供有效的HTML输出。有许多可用的视图引擎,其中一些如下:
-
ASPX
ASPX
-
Razor
剃须刀
-
Spark
火花
-
NHaml
NHaml
-
NDJango
NDJango
-
Hasic
基本
-
Brail
卷帆索
-
Bellevue
贝尔维尤
-
Sharp Tiles
锋利的瓷砖
-
String Template
字符串模板
-
Wing Beats
挥动着翅膀
-
SharpDOM
SharpDOM
Currently most developers prefer to use Razor view engine as it provides very convenient way of programming. All of these view engines may not support ASP.NET MVC.
目前大多数开发人员更喜欢使用Razor视图引擎,因为它提供了非常方便的编程方式。所有这些视图引擎可能都不支持ASP。净MVC。
For more details you can visit this article.
有关更多细节,请参阅本文。
#5
1
View Engine works inside the application for rendering HTML page to the browser or to the user. It can contain HTML tags, server controls and some programming language.
视图引擎在向浏览器或用户呈现HTML页面的应用程序内工作。它可以包含HTML标记、服务器控件和一些编程语言。
Razor is preferred view engine for MVC4 framework.
Razor是MVC4框架的首选视图引擎。
#6
1
In ASP.Net MVC, View engine is the one that works between your view and browser to provide valid HTML output to your browser by considering output provided by your view.There are many types of view engines.
在ASP。Net MVC, View engine是在视图和浏览器之间工作的,它通过考虑视图提供的输出为浏览器提供有效的HTML输出。有很多类型的视图引擎。
1)ASPX
1)ASPX
2)Razor
2)剃须刀
3)Spark
3)火花
4)NHaml
4)NHaml
5)NDJango
5)NDJango
6)Hasic
6)基本
7)Brail
7)抄网
#7
1
I read a descriptive post at http://questionbox.in/view-engine-asp-net-mvc-razor-view-engine-asp-net-mvc-web-form-aspx-view-engine-asp-net-mvc/
我在http://questionbox.in/view-engine-asp-net-mvc-razor-view-engine-asp-net- web- web- web- aspx-view- eng- net-mvc/上看到了一篇描述文章
View engine gives the ability to render the HTML from your view to the browser.
视图引擎提供了将HTML从视图呈现到浏览器的能力。
There are many view engines supported by ASP.NET MVC but the most widely used view engines are
有许多由ASP支持的视图引擎。NET MVC,但最广泛使用的视图引擎是。
- Web form / ASPX view engine.
- Web表单/ ASPX视图引擎。
- Razor view engine.
- Razor视图引擎。
Web form view engine / ASPX view engine:
Web表单视图引擎/ ASPX视图引擎:
- Web Form View Engine / ASPX View Engine is the default view engine for the Asp.net MVC project. It is available from MVC 1.0
- Web表单视图引擎/ ASPX视图引擎是Asp.net MVC项目的默认视图引擎。它可以从MVC 1.0中获得
- The namespace for Web Form Engine is Web.Mvc.WebFormViewEngine
- Web表单引擎的命名空间是Web.Mvc.WebFormViewEngine
- File Extension for this View Engine is similar to Web Form as:
- 此视图引擎的文件扩展名类似于Web表单:
.aspx, for Views just like Web Form pages. .ascx, for Partial Views & Editor Template just like User Controls. .master, for Layout and Master Pages just like Master Pages in Web Forms.
.aspx,用于像Web表单页面一样的视图,.ascx,用于部分视图和编辑模板,就像用户控件一样。
- No support for TDD (Test Driven Development).
- 不支持TDD(测试驱动开发)。
- Web Form Engine does not prevent XSS attacks means any script saved in the database will be fired while rendering the page
- Web表单引擎不能防止XSS攻击,这意味着在呈现页面时,将触发保存在数据库中的任何脚本
- Syntax : <%: Html.ActionLink(“Home”, “Index”) %>
- 语法:< %:Html。ActionLink(“家”、“指数”)% >
Razor View Engine:
Razor视图引擎:
- The Razor View Engine is an advanced view engine, available with MVC 3.0 and later versions
- Razor视图引擎是一个高级视图引擎,可以在MVC 3.0和以后的版本中使用
- Namespace for ASPX view Engine is Web.Razor.
- ASPX视图引擎的命名空间是Web.Razor。
- File Extension for this View Engine is .cshtml (Razor C#), for Views, Partial Views, Editor Template and Layout Pages. .vbhtml (Razor VB.NET), for Views, Partial Views, Editor Template and Layout Pages.
- 此视图引擎的文件扩展名是.cshtml (Razor c#),用于视图、部分视图、编辑器模板和布局页面。
- Supports TDD (Test Driven Development).
- 支持TDD(测试驱动开发)。
- Razor Engine is little bit slow as compared to Web form Engine.
- 与Web表单引擎相比,Razor引擎有点慢。
- Razor Engine prevents XSS attacks(Cross-Site Scripting Attacks) means it encodes the script or html tags like <,> before rendering to view.
- Razor引擎可以防止XSS攻击(跨站点脚本攻击),这意味着它在呈现视图之前会对脚本或html标签进行编码,比如<,>。
-
Razor syntax is easy to understand and much clean than Web Form syntax. Razor uses @ symbol to make the code like as:
Razor语法容易理解,比Web表单语法干净得多。Razor使用@符号把代码做成如下样子:
@Html.ActionLink(“Home”, “Index”)
@Html。ActionLink(“家”、“指数”)
#8
1
View Engine renders the view into HTML form to the browser. If we talk about an MVC application in the .Net Framework, it supports the following 2 view engines:
视图引擎将视图呈现到浏览器的HTML表单中。如果我们在。net框架中讨论MVC应用,它支持以下两个视图引擎:
1. Razor View Engine 2. Web Form/ASPX View Engine
1。Razor视图引擎2。Web表单/ ASPX视图引擎
Differences : 1. Razor View Engine uses Layouts but ASPX view engine uses Master pages.
差异:1。Razor视图引擎使用布局,而ASPX视图引擎使用主页面。
2. Razor View Engine uses partial page but ASPX view engine uses Web User Control.
2。Razor视图引擎使用部分页面,而ASPX视图引擎使用Web用户控件。
3. Razor view engine is not a language, It is Markup syntax.
3所示。Razor视图引擎不是一种语言,它是一种标记语法。
4. @’ symbol uses in Razor Engine to write the code. @Html.ActionLink("Login", "LoginView") ‘<%:’ delimiters use as starting point and ‘ %>’ use as ending point. You can write the code between them in ASPX Engine.
4所示。符号在Razor引擎中用来写代码。@Html。ActionLink("Login", "LoginView") ' <%: '分隔符用作起始点,' %> '作为结束点。您可以在ASPX引擎中编写它们之间的代码。
5. Razor View Engine has .cshtml (with C#) and .vbhtml (with VB) extension for views, Layout and Partial views. ASPX View Engine has a similar extension as in a simple web application like .aspx for the views, .acsx for UserControls and .master for Master Pages.
5。Razor视图引擎有.cshtml(带c#)和.vbhtml(带VB)扩展,用于视图、布局和部分视图。ASPX视图引擎有一个类似于简单的web应用程序的扩展,例如。ASPX的视图,.acsx用于用户控件和。
#9
0
So far every response is related to ASP.NET. If you are looking for a view engine for nodejs, then some of the following are options:
到目前为止,所有的响应都与ASP.NET相关。如果您正在寻找nodejs的视图引擎,那么以下是一些选项:
Jade (Pug)
express-handlebars
ejs
React
There's a whole list of them that I found at https://github.com/expressjs/express/wiki#template-engines but the above ones seem to be the ones I hear about the most.
我在https://github.com/express/express/wikis/wiki #template-engine找到了一个完整的列表,但是上面的似乎是我听到最多的。
#10
-1
Two View Engines:
两个视图引擎:
ASPX
ASPX view engine, the server side script is wrapped between [% %] .ASPX is its extention.
ASPX视图引擎,服务器端脚本被包装在[%].ASPX是它的扩展。
Razor
Razor we use @. Switching between HTML and code is Possible. Razor View extention .CSHTML and .VBHTML
我们使用@剃须刀。在HTML和代码之间切换是可能的。Razor视图扩展.CSHTML和。vbhtml
#1
43
The view engine is responsible for creating HTML from your views. Views are usually some kind of mixup of HTML and a programming language. The pattern behind most of these is called two-step view.
视图引擎负责从视图创建HTML。视图通常是HTML和编程语言的混合体。其中大部分的模式称为两步视图。
For example, ASP.NET comes with its own view engine out of the box. That is the one where views have lots of tags like <% %>
and <%: %>
. It uses the .aspx
file extension.
例如,ASP。NET自带了自己的视图引擎。视图中有很多标签,比如<% >和<%:%>。它使用.aspx文件扩展名。
With ASP.NET MVC3, another out-of-the-box view engine was added, Razor, which has a more appealing syntax, e.g. <div>@Model.UserName</div>
.
ASP。NET MVC3是另一个开箱即用的视图引擎,Razor具有更吸引人的语法,比如
The choice of view engine is important, because the feature sets of view engines are quite different. Some support rendering to PDF files, for instance; some can't be used outside a web context (this is true for the old ASP.NET view engine), while others can (e.g. Razor). 'Offline' rendering of views comes in handy when you want to create HTML emails the same way you build your views and those emails should be sent from a background worker rather than a web application.
视图引擎的选择很重要,因为视图引擎的特性集是完全不同的。例如,一些支持对PDF文件的呈现;有些不能在web上下文之外使用(这对于旧的ASP是正确的。NET视图引擎),而其他人可以(如Razor)。当你想创建HTML电子邮件时,“离线”的视图呈现非常有用,就像你构建视图的方式一样,这些电子邮件应该从后台工作人员而不是web应用程序发送。
There's a nice comparison of asp.net view engines here on SO.
这里有一个很好的asp.net视图引擎的比较。
The good news is that you can use multiple view engines in parallel in ASP.NET MVC, though I wouldn't recommend it unless necessary.
好消息是您可以在ASP中并行地使用多个视图引擎。NET MVC,除非必要,我不会推荐它。
There are some very nice extension points in the Razor engine already. For example, you can provide a custom view base class, a powerful concept that makes it easy to add a lot of functionality in the right place without having to mess with all the gritty details that you'd have to cope with otherwise.
剃须刀引擎已经有了一些很好的扩展点。例如,您可以提供一个自定义视图基类,这是一个强大的概念,它使您可以轻松地在正确的位置添加大量的功能,而不必处理您必须处理的所有棘手的细节。
I'd currently go for Razor.
我现在喜欢剃刀。
#2
7
The view engine is what's responsible for rendering your view, and converting your code into glorious HTML. As such, they are directly responsible for HOW you need to write code in your views.
视图引擎负责呈现视图,并将代码转换为漂亮的HTML。因此,它们直接负责如何在视图中编写代码。
There's basically two ones you need to care about: ASPX and Razor. Razor is, in my opinion, much sleeker and easier to use, at the cost of only being supported in MVC3.
基本上有两个你需要关注的:ASPX和Razor。在我看来,Razor更圆滑、更容易使用,只需要在MVC3中支持就可以了。
For example, a code block in ASPX might look like this:
例如,ASPX中的代码块可能如下所示:
<% foreach(var item in Model) { %>
<tr>
<td><%: item.Name %></td>
</tr>
<% } %>
Whereas the Razor equivalent will look like this:
而剃刀的等价物是这样的:
@foreach(var item in Model) {
<tr>
<td>@item.Name</td>
</tr>
}
#3
2
A view engine is what MVC uses to find and render the views you are requesting from the controller. If you are satisfied with the default routing you probably wont need to change anything, but lets say you wanted to have your shared files usually located in root/views/shared to instead be located in root/common, a custom viewengine is what you will need to create to be able to do that.
视图引擎是MVC用来查找和呈现从控制器请求的视图的。如果你满意默认路由可能不会需要改变什么,但假设你想要共享的文件通常位于根/视图/共享而不是位于根/常见,你需要创建自定义viewengine能够这样做。
Here you can see how to build a viewengine:
在这里,您可以看到如何构建一个视图引擎:
http://coderjournal.com/2009/05/creating-your-first-mvc-viewengine/
http://coderjournal.com/2009/05/creating-your-first-mvc-viewengine/
The view engine is also responsible for rendering the view, but as you are just learning MVC you will probably not need to alter the rendering functionality just yet
视图引擎也负责呈现视图,但由于您只是学习MVC,您可能还不需要修改呈现功能。
#4
2
In MVC, View engine is the one that works between your View and browser to provide valid HTML output to your browser by compiling the code inside your View. There are many view engines available and some of them are following:
在MVC中,视图引擎是在视图和浏览器之间工作的,它通过编译视图中的代码向浏览器提供有效的HTML输出。有许多可用的视图引擎,其中一些如下:
-
ASPX
ASPX
-
Razor
剃须刀
-
Spark
火花
-
NHaml
NHaml
-
NDJango
NDJango
-
Hasic
基本
-
Brail
卷帆索
-
Bellevue
贝尔维尤
-
Sharp Tiles
锋利的瓷砖
-
String Template
字符串模板
-
Wing Beats
挥动着翅膀
-
SharpDOM
SharpDOM
Currently most developers prefer to use Razor view engine as it provides very convenient way of programming. All of these view engines may not support ASP.NET MVC.
目前大多数开发人员更喜欢使用Razor视图引擎,因为它提供了非常方便的编程方式。所有这些视图引擎可能都不支持ASP。净MVC。
For more details you can visit this article.
有关更多细节,请参阅本文。
#5
1
View Engine works inside the application for rendering HTML page to the browser or to the user. It can contain HTML tags, server controls and some programming language.
视图引擎在向浏览器或用户呈现HTML页面的应用程序内工作。它可以包含HTML标记、服务器控件和一些编程语言。
Razor is preferred view engine for MVC4 framework.
Razor是MVC4框架的首选视图引擎。
#6
1
In ASP.Net MVC, View engine is the one that works between your view and browser to provide valid HTML output to your browser by considering output provided by your view.There are many types of view engines.
在ASP。Net MVC, View engine是在视图和浏览器之间工作的,它通过考虑视图提供的输出为浏览器提供有效的HTML输出。有很多类型的视图引擎。
1)ASPX
1)ASPX
2)Razor
2)剃须刀
3)Spark
3)火花
4)NHaml
4)NHaml
5)NDJango
5)NDJango
6)Hasic
6)基本
7)Brail
7)抄网
#7
1
I read a descriptive post at http://questionbox.in/view-engine-asp-net-mvc-razor-view-engine-asp-net-mvc-web-form-aspx-view-engine-asp-net-mvc/
我在http://questionbox.in/view-engine-asp-net-mvc-razor-view-engine-asp-net- web- web- web- aspx-view- eng- net-mvc/上看到了一篇描述文章
View engine gives the ability to render the HTML from your view to the browser.
视图引擎提供了将HTML从视图呈现到浏览器的能力。
There are many view engines supported by ASP.NET MVC but the most widely used view engines are
有许多由ASP支持的视图引擎。NET MVC,但最广泛使用的视图引擎是。
- Web form / ASPX view engine.
- Web表单/ ASPX视图引擎。
- Razor view engine.
- Razor视图引擎。
Web form view engine / ASPX view engine:
Web表单视图引擎/ ASPX视图引擎:
- Web Form View Engine / ASPX View Engine is the default view engine for the Asp.net MVC project. It is available from MVC 1.0
- Web表单视图引擎/ ASPX视图引擎是Asp.net MVC项目的默认视图引擎。它可以从MVC 1.0中获得
- The namespace for Web Form Engine is Web.Mvc.WebFormViewEngine
- Web表单引擎的命名空间是Web.Mvc.WebFormViewEngine
- File Extension for this View Engine is similar to Web Form as:
- 此视图引擎的文件扩展名类似于Web表单:
.aspx, for Views just like Web Form pages. .ascx, for Partial Views & Editor Template just like User Controls. .master, for Layout and Master Pages just like Master Pages in Web Forms.
.aspx,用于像Web表单页面一样的视图,.ascx,用于部分视图和编辑模板,就像用户控件一样。
- No support for TDD (Test Driven Development).
- 不支持TDD(测试驱动开发)。
- Web Form Engine does not prevent XSS attacks means any script saved in the database will be fired while rendering the page
- Web表单引擎不能防止XSS攻击,这意味着在呈现页面时,将触发保存在数据库中的任何脚本
- Syntax : <%: Html.ActionLink(“Home”, “Index”) %>
- 语法:< %:Html。ActionLink(“家”、“指数”)% >
Razor View Engine:
Razor视图引擎:
- The Razor View Engine is an advanced view engine, available with MVC 3.0 and later versions
- Razor视图引擎是一个高级视图引擎,可以在MVC 3.0和以后的版本中使用
- Namespace for ASPX view Engine is Web.Razor.
- ASPX视图引擎的命名空间是Web.Razor。
- File Extension for this View Engine is .cshtml (Razor C#), for Views, Partial Views, Editor Template and Layout Pages. .vbhtml (Razor VB.NET), for Views, Partial Views, Editor Template and Layout Pages.
- 此视图引擎的文件扩展名是.cshtml (Razor c#),用于视图、部分视图、编辑器模板和布局页面。
- Supports TDD (Test Driven Development).
- 支持TDD(测试驱动开发)。
- Razor Engine is little bit slow as compared to Web form Engine.
- 与Web表单引擎相比,Razor引擎有点慢。
- Razor Engine prevents XSS attacks(Cross-Site Scripting Attacks) means it encodes the script or html tags like <,> before rendering to view.
- Razor引擎可以防止XSS攻击(跨站点脚本攻击),这意味着它在呈现视图之前会对脚本或html标签进行编码,比如<,>。
-
Razor syntax is easy to understand and much clean than Web Form syntax. Razor uses @ symbol to make the code like as:
Razor语法容易理解,比Web表单语法干净得多。Razor使用@符号把代码做成如下样子:
@Html.ActionLink(“Home”, “Index”)
@Html。ActionLink(“家”、“指数”)
#8
1
View Engine renders the view into HTML form to the browser. If we talk about an MVC application in the .Net Framework, it supports the following 2 view engines:
视图引擎将视图呈现到浏览器的HTML表单中。如果我们在。net框架中讨论MVC应用,它支持以下两个视图引擎:
1. Razor View Engine 2. Web Form/ASPX View Engine
1。Razor视图引擎2。Web表单/ ASPX视图引擎
Differences : 1. Razor View Engine uses Layouts but ASPX view engine uses Master pages.
差异:1。Razor视图引擎使用布局,而ASPX视图引擎使用主页面。
2. Razor View Engine uses partial page but ASPX view engine uses Web User Control.
2。Razor视图引擎使用部分页面,而ASPX视图引擎使用Web用户控件。
3. Razor view engine is not a language, It is Markup syntax.
3所示。Razor视图引擎不是一种语言,它是一种标记语法。
4. @’ symbol uses in Razor Engine to write the code. @Html.ActionLink("Login", "LoginView") ‘<%:’ delimiters use as starting point and ‘ %>’ use as ending point. You can write the code between them in ASPX Engine.
4所示。符号在Razor引擎中用来写代码。@Html。ActionLink("Login", "LoginView") ' <%: '分隔符用作起始点,' %> '作为结束点。您可以在ASPX引擎中编写它们之间的代码。
5. Razor View Engine has .cshtml (with C#) and .vbhtml (with VB) extension for views, Layout and Partial views. ASPX View Engine has a similar extension as in a simple web application like .aspx for the views, .acsx for UserControls and .master for Master Pages.
5。Razor视图引擎有.cshtml(带c#)和.vbhtml(带VB)扩展,用于视图、布局和部分视图。ASPX视图引擎有一个类似于简单的web应用程序的扩展,例如。ASPX的视图,.acsx用于用户控件和。
#9
0
So far every response is related to ASP.NET. If you are looking for a view engine for nodejs, then some of the following are options:
到目前为止,所有的响应都与ASP.NET相关。如果您正在寻找nodejs的视图引擎,那么以下是一些选项:
Jade (Pug)
express-handlebars
ejs
React
There's a whole list of them that I found at https://github.com/expressjs/express/wiki#template-engines but the above ones seem to be the ones I hear about the most.
我在https://github.com/express/express/wikis/wiki #template-engine找到了一个完整的列表,但是上面的似乎是我听到最多的。
#10
-1
Two View Engines:
两个视图引擎:
ASPX
ASPX view engine, the server side script is wrapped between [% %] .ASPX is its extention.
ASPX视图引擎,服务器端脚本被包装在[%].ASPX是它的扩展。
Razor
Razor we use @. Switching between HTML and code is Possible. Razor View extention .CSHTML and .VBHTML
我们使用@剃须刀。在HTML和代码之间切换是可能的。Razor视图扩展.CSHTML和。vbhtml