|
From: "Sylvain" on 19 Apr 2007 13:13 Hello, I have a probleme with an array like that: $array[1]['mother_id'] = 0; $array[1]['father_id'] = 0; $array[1]['name'] = foo; $array[2]['mother_id'] = 0; $array[2]['father_id'] = 0; $array[2]['name'] = foo1; $array[3]['mother_id'] = 1; $array[3]['father_id'] = 2; $array[3]['name'] = foo2; In PHP I print the name of the parents with: $array[$array[$key]['mother_id']]['name'] I tried to do the same thing with smarty : {$array[$array[$key].mother_id].name} But it does not work. Do you have an idea ? Regards
From: Danilo Buerger on 19 Apr 2007 20:38 Hey there! Please take a look at http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign .. This will solve your problem. Bye. Sylvain schrieb: > Hello, > > I have a probleme with an array like that: > > $array[1]['mother_id'] = 0; > $array[1]['father_id'] = 0; > $array[1]['name'] = foo; > > $array[2]['mother_id'] = 0; > $array[2]['father_id'] = 0; > $array[2]['name'] = foo1; > > $array[3]['mother_id'] = 1; > $array[3]['father_id'] = 2; > $array[3]['name'] = foo2; > > In PHP I print the name of the parents with: > > $array[$array[$key]['mother_id']]['name'] > > I tried to do the same thing with smarty : > > {$array[$array[$key].mother_id].name} > > But it does not work. Do you have an idea ? > > Regards >
From: "Sylvain" on 20 Apr 2007 06:10 "Danilo Buerger" <danilo(a)blizzz.org> a �crit dans le message de news: 46280B9E.1020906(a)blizzz.org... > Hey there! > > Please take a look at > http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign > . This will solve your problem. > > Bye. > > Sylvain schrieb: >> Hello, >> >> I have a probleme with an array like that: >> >> $array[1]['mother_id'] = 0; >> $array[1]['father_id'] = 0; >> $array[1]['name'] = foo; >> >> $array[2]['mother_id'] = 0; >> $array[2]['father_id'] = 0; >> $array[2]['name'] = foo1; >> >> $array[3]['mother_id'] = 1; >> $array[3]['father_id'] = 2; >> $array[3]['name'] = foo2; >> >> In PHP I print the name of the parents with: >> >> $array[$array[$key]['mother_id']]['name'] >> >> I tried to do the same thing with smarty : >> >> {$array[$array[$key].mother_id].name} >> >> But it does not work. Do you have an idea ? >> >> Regards >> Yeah, I did like that. Thanks.
|
Pages: 1 Prev: how to acces array keys that start with '#' Next: you novel |