Yaf_View_Simple::__construct

(Yaf >=1.0.0)

Yaf_View_Simple::__constructYaf_View_Simple 的构造方法

说明

final public Yaf_View_Simple::__construct(string $template_dir, array $options = ?)

参数

template_dir

模板的基本路径,Yaf 默认为 APPLICATOIN . "/views"。

options

Options for the engine, as of Yaf 2.1.13, you can use short tag
      "<?=$var?>" in your template(regardless of "short_open_tag"), 
      so comes a option named "short_tag",  you can switch this off 
      to prevent use short_tag in template.

示例

示例 #1 Yaf_View_Simple::__constructor() 示例

<?php
define
("TEMPLATE_DIRECTORY", APPLICATOIN_PATH . '/views');
$view = new Yaf_View_Simple(TEMPLATE_DIRECTORY, array(
'short_tag' => false //doesn't allow use short tag in template
));
?>
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top