For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > April 2007 > Re: [SMARTY] Problem with array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Problem with array
Danilo Buerger

2007-04-19, 10:06 pm

Hey there!

Please take a look at
http://smarty.php.net/manual/en/lan...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
>

Sylvain

2007-04-20, 7:07 pm


"Danilo Buerger" <danilo@blizzz.org> a écrit dans le message de news:
46280B9E.1020906@blizzz.org...[color=darkred]
> Hey there!
>
> Please take a look at
> http://smarty.php.net/manual/en/lan...function.assign
> . This will solve your problem.
>
> Bye.
>
> Sylvain schrieb:

Yeah, I did like that. Thanks.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com