Name

getTags() — 取得模板标签

说明

string getTags(object template);
该函数将返回模板内全部的标签名/值。 参数如下:

  • template 模板对象

Note

该函数是实验性的!


Example 14.29. getTags()

  1. <?php
  2. include('Smarty.class.php');
  3. $smarty = new Smarty;
  4.  
  5. // 创建模板对象
  6. $tpl = $smarty->createTemplate('index.tpl');
  7.  
  8. // 取得标签
  9. $tags = $smarty->getTags($tpl);
  10.  
  11. print_r($tags);
  12.  
  13. ?>
  14.  

原文: https://www.smarty.net/docs/zh_CN/api.get.tags.tpl