Re: Documentation example

From: Date: Wed, 02 May 2001 13:07:25 +0000
Subject: Re: Documentation example
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-659@lists.php.net to get a copy of this message
On Wed, 02 May 2001, Alain Fontaine wrote: > Hello, > > <-- snip --> > {* This is an example of printing an associative array > of data within a section *} > {section name=customer loop=$contacts} > name: {$customer/contacts.name}<br> > home: {$customer/contacts.home}<br> > cell: {$customer/contacts.cell}<br> > e-mail: {$customer/contacts.email}<p> > {/section} > <-- snip --> > > In this example, how is the contacts array built in PHP? Like this, for > instance, doing it completely manually: > > $contacts[0][name] = "bla"; > $contacts[0][home] = "tsss"; > $contacts[0][cell] = "123"; > $contacts[1][name] = "bla"; > $contacts[1][home] = "tsss"; > $contacts[1][cell] = "123"; > > In other words, is the $contacts array a two-dimensional array where the > second dimension's keys are name,home,cell and email ? Yes, or it can be built from database or any other number of sources. -Andrei * Entropy isn't what it used to be. *

« previous php.smarty.general (#659) next »