RegisterView registers and loads a view engine middleware for this group of routes. It overrides any of the application's root registered view engines. To register a view engine per handler chain see the `Context.ViewEngine` instead. Read `Configuration.ViewEngineContextKey` documentation for more.
(viewEngine context.ViewEngine)
| 1756 | // To register a view engine per handler chain see the `Context.ViewEngine` instead. |
| 1757 | // Read `Configuration.ViewEngineContextKey` documentation for more. |
| 1758 | func (api *APIBuilder) RegisterView(viewEngine context.ViewEngine) { |
| 1759 | if err := viewEngine.Load(); err != nil { |
| 1760 | api.logger.Error(err) |
| 1761 | return |
| 1762 | } |
| 1763 | |
| 1764 | handler := func(ctx *context.Context) { |
| 1765 | ctx.ViewEngine(viewEngine) |
| 1766 | ctx.Next() |
| 1767 | } |
| 1768 | api.Use(handler) |
| 1769 | api.UseError(handler) |
| 1770 | // Note (@kataras): It does not return the Party in order |
| 1771 | // to keep the iris.Application a compatible Party. |
| 1772 | } |
| 1773 | |
| 1774 | // FallbackView registers one or more fallback views for a template or a template layout. |
| 1775 | // Usage: |