跳到主要内容
版本:Next

ContextView

View instance for each request.

It will find the view engine, and render it. The view engine should be registered in ViewManager.

Implements

Index

Constructors

constructor

Properties

ctx

ctx: any

viewConfig

viewConfig: any

viewManager

viewManager: ViewManager

Methods

render

  • render(name: string, locals?: Record<string, any>, options?: RenderOptions): Promise<string>
  • Render a file by view engine, then set to body

renderString

  • renderString(tpl: string, locals?: Record<string, any>, options?: RenderOptions): Promise<string>
  • Render a template string by view engine