Aller au contenu principal
Version: Next

ViewManager

Hierarchy

  • Map
    • ViewManager

Index

Constructors

externalconstructor

Methods

publicaddLocals

  • addLocals(key: any, localValue: any): void
  • add a global data for all views

publicfindEngine

  • findEngine(ext: string): string

publicgetLocals

  • getLocals(): {}
  • get global locals data

publicresolve

  • resolve(name: string): Promise<string>
  • Resolve the path based on the given name, if the name is user.html and root is view (by default), it will return view/user.html

publicuse

  • use(name: string, viewEngine: new (...args: any[]) => IViewEngine): void
  • This method can register view engine.

    You can define a view engine class contains two method, render and renderString

    class View {
    render() {}
    renderString() {}
    }