File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
1 . Add the CompiledHandlebars.ViewEngine.Core and CompiledHandlebars.RuntimeUtils Nuget Package
4
4
2 . Add the CompiledHandlebarsViewEngine to the MVC-Services and configure the ViewLocationFormats.
5
- ```
5
+ ``` csharp
6
6
var ve_options = new CompiledHandlebarsViewEngineOptions ()
7
7
{
8
8
ViewLocationFormats = new string [] { " ~/Views/{1}/{0}.hbs" , " ~/Views/{0}.hbs" , " ~/{0}.hbs"
@@ -13,9 +13,9 @@ services.AddMvc().AddViewOptions(options =>
13
13
options .ViewEngines .Add (new CompiledHandlebarsViewEngine (typeof (Startup ).GetTypeInfo ().Assembly , ve_options ));
14
14
});
15
15
```
16
- 3 . Call the View in the Controller by Name
17
- ```
18
- return View("Greet ", name );
16
+ 3 . Call the View in the Controller by Name and pass any ViewModel
17
+ ```csharp
18
+ return View (" ViewName " , viewModel );
19
19
```
20
20
21
21
# Using the HandlebarsCompiler in an asp.net core (.net core) project
You can’t perform that action at this time.
0 commit comments