Re: [SMARTY] number of array elements

From: Date: Sat, 02 Oct 2004 04:03:13 +0000
Subject: Re: [SMARTY] number of array elements
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11851@lists.php.net to get a copy of this message
Try: {$wo[p]->locations|@count} Since the php count function can be used as a modifier and you'd use @ to have the modifier treat its input as an array. --- Steve <lists@iwsys.com> wrote: > In a template I have the following section: > > {section name=p loop=$wo} // $wo is an array of objects > > $wo[p]->locations is an array of objects > > I would like to know if the number of values in the $wo[p]->locations > array > is already available. If so, what is the syntax to display it in a > template? > > Thanks in advance! > > Steve

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