Re: [SMARTY] size of array
| From: | messju mohr | Date: | Tue, 11 Jan 2005 11:44:43 +0000 |
| Subject: | Re: [SMARTY] size of array | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12144@lists.php.net to get a copy of this message | ||
On Tue, Jan 11, 2005 at 11:15:29AM +0000, Abdul-Wahid Paterson wrote:
> Thanks messju for that but I should have been a bit clearer. I need
> something a bit more.
>
> I really want to be able to carry out a mathematical funciton on the
> size of the array before displaying the result
>
> something like
>
> {assign var="length" value=count($array)/2}
then you can
a) check wether it's easier/cleaner/smarty to do this computation on
the php-side where $array comes from.
and if a) doesn't work out
b) {math equation="count/2" count=$array|@count assign=length}'
greetings
messju
> On Tue, 11 Jan 2005 14:08:39 +0300, messju mohr
> <messju@lammfellpuschen.de> wrote:
> > On Tue, Jan 11, 2005 at 10:42:16AM +0000, Abdul-Wahid Paterson wrote:
> > > Hi,
> > >
> > > Is there a way of finding out the size of an array from within a
> > > smarty template?
> >
> > {$array|@count}
> >
> > it's one of the examples at
> > http://smarty.php.net/manual/en/language.modifiers.php
> >
> > > Abdul-Wahid
> > >
> > > --
> > > Smarty General Mailing List (http://smarty.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >