PHP Class think\view\driver\Php

Mostrar archivo Open project: top-think/framework

Protected Properties

Property Type Description
$config 模板引擎参数

Public Methods

Method Description
__construct ( $config = [] )
config ( string | array $name, mixed $value = null ) : void 配置模板引擎
display ( string $content, array $data = [] ) : void 渲染模板内容
exists ( string $template ) : boolean 检测是否存在模板文件
fetch ( string $template, array $data = [] ) : void 渲染模板文件

Private Methods

Method Description
parseTemplate ( string $template ) : string 自动定位模板文件

Method Details

__construct() public method

public __construct ( $config = [] )

config() public method

配置模板引擎
public config ( string | array $name, mixed $value = null ) : void
$name string | array 参数名
$value mixed 参数值
return void

display() public method

渲染模板内容
public display ( string $content, array $data = [] ) : void
$content string 模板内容
$data array 模板变量
return void

exists() public method

检测是否存在模板文件
public exists ( string $template ) : boolean
$template string 模板文件或者模板规则
return boolean

fetch() public method

渲染模板文件
public fetch ( string $template, array $data = [] ) : void
$template string 模板文件
$data array 模板变量
return void

Property Details

$config protected_oe property

模板引擎参数
protected $config