section loop issue
| From: | Peter | Date: | Tue, 27 Jan 2004 23:45:21 +0000 |
| Subject: | section loop issue | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10883@lists.php.net to get a copy of this message | ||
Hello,
I use the section stuff from smarty very often and it's great. But currently I have an problem and dont know why.
Following data are available:
### input data array ###
Array ( [1] => Array ( [right_id] => 1 [area_id] => 1 [application_id] => 1 [define_name] => ADD_USER [has_implied] => N [has_level] => N [has_scope] => N [name] => useradd [comment] => add a new user to the system ) )
### php code ###
/**
* List permissions
*/
$page->smarty->assign('new_perm_link', SCRIPTNAME.'?MN='.$_GET['MN'].'&AC=add_user_perm');
$page->smarty->assign('link_string', SCRIPTNAME.'?MN='.$_GET['MN'].'&AC='.$_GET['AC'].'');
$page->smarty->assign('popup_string', 'popupLoader.php?MN='.$_GET['MN'].'&AC='.$_GET['AC'].'_editPerm');
$page->smarty->assign('uright', $admin->perm->getRights( array('where_application_id' => $admin->perm->getCurrentApplication())) );
### smarty code ###
{ section name="permission" loop=$uright }
<tr height="25">
<td width="30" height="25">
<div align="center">
<img src="{$IMAGEPATH}/a-bullet.gif" alt="" height="10" width="10" border="0"></div>
</td>
<td bgcolor="#f6f6f6" width="30%" height="25">
<img src="{$IMAGEPATH}/clear.gif" height="1" width="10">
{$uright[permission].name} <font class="small">({$uright[permission].comment})</font>
</td>
<td bgcolor="#f6f6f6" height="25">
[ <a href="javascript:popup('{$popup_string}&perm_id={$uright[permission].right_id}',600,500)"><img src="{$IMAGEPATH}/icon-zoom.gif" border="0"> edit permission</a> ]
<img src="{$IMAGEPATH}/clear.gif" height="1" width="13" border="0">
[ <a href="{$link_string}?do=delete&right_id={$uright[permission].right_id}"><img src="{$IMAGEPATH}/icon-recycle.gif" border="0"> delete permission</a> ]
</td>
</tr>
<tr height="1">
<td width="30" height="1"></td>
<td colspan="2" bgcolor="#888888" height="1"></td>
</tr>
{ /section }
### Result Html Source ###
</tr>
<tr height="25">
<td width="30" height="25">
<div align="center">
<img src="http://pros/tux/images/a-bullet.gif" alt="" height="10" width="10" border="0"></div>
</td>
<td bgcolor="#f6f6f6" width="30%" height="25">
<img src="http://pros/tux/images/clear.gif" height="1" width="10">
<font class="small">()</font>
</td>
<td bgcolor="#f6f6f6" height="25">
[ <a href="javascript:popup('popupLoader.php?MN=admin_permission&AC=list_user_perm_editPerm&perm_id=',600,500)"><img src="http://pros/tux/images/icon-zoom.gif" border="0"> edit permission</a> ]
<img src="http://pros/tux/images/clear.gif" height="1" width="13" border="0">
[ <a href="main.php?MN=admin_permission&AC=list_user_perm?do=delete&right_id="><img src="http://pros/tux/images/icon-recycle.gif" border="0"> delete permission</a> ]
</td>
</tr>
It will be printed but no values are there.
No $uright[permission].name or $uright[permission].comment or $uright[permission].right_id is there.
May someone can tell me why?
Cheers
-Peter