略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_View_Simple::__construct

2024-11-15

Yaf_View_Simple::__construct

(Yaf >=1.0.0)

Yaf_View_Simple::__constructConstructor of Yaf_View_Simple

说明

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

参数

tempalte_dir

模板的基本路劲,默认为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()example

<?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
   
));
?>

返回值

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/yaf-view-simple.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3