PHP Class think\view\driver\Php

Afficher le fichier Open project: top-think/framework

Protected Properties

Свойство Type Description
$config 模板引擎参数

Méthodes publiques

Méthode 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

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

Method Details

__construct() public méthode

public __construct ( $config = [] )

config() public méthode

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

display() public méthode

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

exists() public méthode

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

fetch() public méthode

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

Property Details

$config protected_oe property

模板引擎参数
protected $config