阅读(1539) (0)

template_path()

2017-06-13 18:10:44 更新

作用:获取模板目录的绝对地址。

语法string teplate_path([string $filename])

参数$filename 模板目录下的文件。

返回值

  • 如果未提供参数,则返回模板目录路径
  • 如果提供 $filename 参数,则返回 $filename 的路径。

别名

  • template_dir()

示例

<?php
echo template_path(); //输出模板目录地址
echo template_path('test.php'); //输出模板目录下 test.php 文件的路径