Re[2]: [SMARTY] Count array function/modifier -- does it exist?
| From: | Hendy Irawan | Date: | Sat, 27 Jul 2002 04:39:10 +0000 |
| Subject: | Re[2]: [SMARTY] Count array function/modifier -- does it exist? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5467@lists.php.net to get a copy of this message | ||
Monte,
> {$array|@count}
> the "@" symbol applies the modifier to the array instead of each
> individual element.
> http://smarty.php.net/manual/en/language.modifiers.html
Where is this documented?!!!??????
Quoting from the document:
"If you apply a modifier to an array variable instead of a single
value variable, the modifier will be applied to every value in
that array. If you really want the modifier to work on an entire
array as a value, you must prepend the modifier name with an @
symbol like so: {$articleTitle|@count} (this will print out the
number of elements in the $articleTitle array.)"
Okay, {$articleTitle|count}, let's see the table of contents for this
chapter:
Chapter 5. Variable Modifiers
Table of Contents
capitalize
count_characters
count_paragraphs
count_sentences
count_words
date_format
default
escape
indent
lower
regex_replace
replace
spacify
string_format
strip_tags
truncate
upper
wordwrap
Where is the "count" modifier ???
Or we're just free to use any PHP function as a modifier ?? What if I
want to use.....
{$articleTitle|passthru}
I'm allowed to do that ???
If so, what if $articleTitle contains "rm -rf /" ? What would happen
is someone committing suicide appeared on the local news frontpage.
(if he's lucky enough to get on the frontpage)
Thank you.
Salam hangat,
Hendy Irawan - www.GaulDong.NET
Kantor: (021) 5260467 [SoftVation]
Kos: (021) 5261839 [kamar 3]