<tr>
<td height="25" background="__PUBLIC__/img/star.jpg"> </td>
</tr>
<foreach name='stars' item='vo'>
<tr>
<td height="25"><{$vo.name}></td>
</tr>
</foreach>
</table>
这个代码,在独立一个页面的时候可以正常使用,但是放到其他页面去,就会出现错误。我查看了缓存文件,两个生成的代码都是一致的:
<table width="175" border="0" bgcolor="#A2c2e6">
<tr>
<td height="25" background="__PUBLIC__/img/star.jpg"> </td>
</tr>
<?php if(is_array($stars)): foreach($stars as $key=>$vo): ?><tr>
<td height="25"><?php echo ($vo["name"]); ?></td>
</tr><?php endforeach; endif; ?>
</table>
在独立使用action的时候可以正常显示,但是在其他页面中时,trace报错:[8] Undefined variable: stars H:\AppServ\www\new2\App\Runtime\Cache\a331258d2c8c3153590e330e68bfe150.php 第 262 行.
我看了缓存文件,确定代码是没问题的,估计是架构的bug吧。用volist也是报一样的错。看到3月份已经有人提出这个错误了http://www.thinkphp.cn/bug/2252.html
新发布的3.13也试过了,还是同样报错。希望能重视。因为在这个架构下,这段代码会自动跳过,不执行。
最佳答案
