Constants

BEAN_NAME

BEAN_NAME

默认 bean 名

Properties

$contentType

$contentType : string

默认的 content-type

Type

string

$model

$model : array

模型对象

Type

array

$viewRoot

$viewRoot : string

视图主目录,可以在 config.php 中配置

Type

string

$file

$file : string

视图文件

Type

string

$twig

$twig : \Twig\Environment

twig 实例

Type

\Twig\Environment

$module

$module : string

模块名

Type

string

Methods

render()

render(\hymie\Result  $result) : void

渲染视图

Parameters

\hymie\Result $result

结果对象

getView()

getView(string  $module, string  $result) : void

获取视图的工厂方法

Parameters

string $module
string $result

getContentType()

getContentType() 

Get the value of contentType

setContentType()

setContentType(  $contentType) : self

Set the value of contentType

Parameters

$contentType

Returns

self

getModel()

getModel() 

Get the value of model

setModel()

setModel(  $model) : self

Set the value of model

Parameters

$model

Returns

self

__construct()

__construct(string  $module, string  $file) 

构造函数

Parameters

string $module

模块名

string $file

模板文件名,不带后缀,默认后缀是 .html

header()

header() 

addTwigFunctions()

addTwigFunctions() : void

向 twig 中注册 context_path U _U 函数