A template engine uses a specific template and the data in a routing context to render a resource into a buffer.
Concrete implementations exist for several well-known template engines.
deprecated | |
---|---|
package |
Default |
__construct()
isCachingEnabled() : boolean
boolean
True if template files are cached; otherwise, false.
render( $arg0, $arg1, $arg2, $arg3 = null) : void
Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".
param $context [array] the routing context param $templateFileName [string] the template file name to use param $handler [callable] the handler that will be called with a result containing the buffer or a failure. render($context, $templateFileName, $handler)
Render the template
param $context [RoutingContext] the routing context
param $templateFileName [string] the template file name to use
param $handler [callable] the handler that will be called with a result containing the buffer or a failure.
this method is deprecated
render($context, $templateFileName, $handler)
Render the template
NOTE if you call method directly (i.e. not using @see \io\vertx\jphp\ext\web\handler\TemplateHandler) make sure
that templateFileName is sanitized via
param $context [RoutingContext] the routing context
param $templateDirectory [string] the template directory to use
param $templateFileName [string] the relative template file name to use
param $handler [callable] the handler that will be called with a result containing the buffer or a failure.
this method is deprecated
render($context, $templateDirectory, $templateFileName, $handler)
RoutingContext | array
string
callable | string
callable