TemplateHandler

A handler which renders responses using a template engine and where the template name is selected from the URI path.

package

Default

Methods

__construct

__construct() 

Create a handler

create( $arg0,  $arg1 = null,  $arg2 = null) : \io\vertx\jphp\ext\web\handler\TemplateHandler
static

param $engine [TemplateEngine] the template engine create($engine)

Create a handler

param $engine [TemplateEngine] the template engine param $templateDirectory [string] the template directory where templates will be looked for param $contentType [string] the content type header to be used in the response create($engine, $templateDirectory, $contentType)

Arguments

$arg0

TemplateEngine

$arg1

string

$arg2

string

Response

\io\vertx\jphp\ext\web\handler\TemplateHandler

the handler

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

RoutingContext

Set the index template

setIndexTemplate( $arg0) : $this

Arguments

$arg0

string

Response

$this

a reference to this, so the API can be used fluently

Constants

The default directory where templates will be looked for

DEFAULT_TEMPLATE_DIRECTORY
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

The default content type header to be used in the response

DEFAULT_CONTENT_TYPE
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

The default index page

DEFAULT_INDEX_TEMPLATE
var

php文件只是为了写代码方便,常量的实际值请参考原java文件