Yaf_View_Simple::getScriptPath

(Yaf >=1.0.0)

Yaf_View_Simple::getScriptPath获取模板目录

说明

public function Yaf_View_Simple::getScriptPath(): string

获取查找模板时使用的目录。

参数

此函数没有参数。

返回值

以字符串形式返回模板目录;如果尚未设置,则返回 null

示例

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

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        /* 查找模板时使用的目录,
         * 通常是 application.view.directory */
        echo $this->getView()->getScriptPath();
    }
}
?>

以上示例的输出类似于:

/var/www/html/application/views

参见