首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Yaf_View_Simple::__construct

(Yaf >=1.0.0)

Yaf_View_Simple :: __ construct - Yaf_View_Simple的构造函数

描述

代码语言:javascript
复制
final public Yaf_View_Simple::__construct ( string $template_dir [, array $options ] )

参数

template_dir

模板的基础目录默认为APPLICATOIN。“/ views”为Yaf。

options

代码语言:javascript
复制
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()示例

代码语言:javascript
复制
<?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
   ));
?>

返回值

← Yaf_View_Simple::clear

Yaf_View_Simple::display →

扫码关注腾讯云开发者

领取腾讯云代金券