OT: syntax advice please
| From: | Peter Bowyer | Date: | Tue, 30 Oct 2001 19:10:32 +0000 |
| Subject: | OT: syntax advice please | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1771@lists.php.net to get a copy of this message | ||
Hello,
Sorry for the off-topic posting, i just can't think of anywhere else where I could get an answer :-(
I'm currently writing a few smarty_func_ things for use in a future postcard application. And as usual, I've come up with two different syntaxes for the boxes. I have the option of:
{list_new_cards age=7 number=3}
or
{list_cards type="new" age=7 number=3}
and
{list_top_cards number=3}
or
{list_cards type="top" number=3}
which in their shortest form would become:
{list_top_cards}
or
{list_cards type="top"}
Which do you think would be easier to understand for the average HTML programmer? The first syntax means two separate functions in Smarty.addon.php whereas the second means only one function with a switch loop in it. I can't decide whether two function is better than one or not, but what really matters is which one is clearer.
Any feedback gratefully received!
TIA,
Peter.
--
Devon Railway Centre - a great day out!
http://www.devonrailwaycentre.co.uk