0

In existing codebase, I found a line of

   {foreach from=$app_list item=app name=apps}
       {item table=application sid=$app.APPLICATION_SID}
   {/foreach}

I cannot find explanations to the line {item ... } in documentation, nor find where application and sid are defined.

Can anyone explain what this line is doing? Without this line, the list of app names cannot be displayed.

4

2 回答 2

0

检查调用此函数的代码。最有可能application并且$app正在那里设置。

于 2012-10-26T21:59:00.820 回答
0

它绝对看起来像一个自定义函数。有两种可能:

  1. 包含一个定义自定义函数的模板。寻找字符串{function item{function name=item

  2. 它也可以是一个用 PHP 编写的 smarty 扩展。查找名为function.item.php. 它可能在 Smarty 的plugins目录中,也可能在您的源代码树中的某个位置。您可以尝试查看您的项目用于 Smarty 的设置代码,并查看是否调用了 Smarty 方法setPluginsDir()addPluginsDir()方法。如果您使用的是旧版本的 Smarty,请查找对->plugins_dir.

于 2012-10-26T22:55:21.927 回答