Re: [SMARTY] Re: need help with executing own function
| From: | zuhaimi zainal | Date: | Tue, 18 Jan 2005 17:12:35 +0000 |
| Subject: | Re: [SMARTY] Re: need help with executing own function | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12174@lists.php.net to get a copy of this message | ||
thanks.. thats another way of doing it :).
On 18 Jan 2005 16:38:05 -0000, Matthew Weier O'Phinney
<matthew@garden.org> wrote:
>
> Don't. Pass an associative array of car types:
>
> $types = array(
> 1 => 'Sedan',
> 2 => 'Hatchback'
> );
>
> and pass that to the template. Then, when you need the string version:
>
> <td>Car Type:</td><td>{$types[$car->cartype]}</td>
>
> That way you don't need to muck about with creating Smarty functions or
> modifiers.
>
> --
> Matthew Weier O'Phinney |
> mailto:matthew@garden.org
> Webmaster and IT Specialist | http://www.garden.org
> National Gardening Association | http://www.kidsgardening.comÄZTe`
> Æ€‚±Xû
> 802-863-5251 x156 |
> http://nationalgardenmonth.org
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>