|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
wario Smarty n00b
Joined: 12 Aug 2003 Posts: 3
|
Posted: Tue Aug 12, 2003 5:05 pm Post subject: Associative array |
|
|
I have a class function that bring all REQUEST variabiles and
put in associative array.
class request()
{
...
function requestHiddenVars()
{
$hidden_vars = array();
while(list($id, $value)=each($this->arrayVar))
{
$hidden_vars[$id] = $value;
}
reset($this->arrayVar);
return $hidden_vars;
}
in my php page i made this:
$hidden_vars = $request->requestHiddenVars();
$personal->assign('hidden_vars', $hidden_vars);
in personal.tpl I tried
{section name=i loop=$hidden_vars}
{$hidden_vars[i]}
{/section}
but nothing print,
what can i do ?????
Thank to all and sorry for my poor english!
|
|
Back to top |
|
wario Smarty n00b
Joined: 12 Aug 2003 Posts: 3
|
Posted: Tue Aug 12, 2003 5:21 pm Post subject: |
|
|
I find it in smarty forum and work perfectly
{foreach from=$hidden_vars item=i key=k}
{$k} : {$i}
{/foreach}
smarty great |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Tue Aug 12, 2003 5:23 pm Post subject: |
|
|
Ok i was half way through my post and you solve your own problem _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|