Skip to content

getTags()

返回模板使用的标签

描述

string

getTags

object

template

此函数返回模板使用的所有标签的标签名/属性对的数组。它使用以下参数:

  • template 是模板对象。

注意

这个函数是实验性的。

    <?php
    include('Smarty.class.php');
    $smarty = new Smarty;

    // 创建模板对象
    $tpl = $smarty->createTemplate('index.tpl');

    // 获取标签
    $tags = $smarty->getTags($tpl);

    print_r($tags);

    ?>