Re: [SMARTY] Re: need help with executing own function

From: Date: Tue, 18 Jan 2005 20:25:57 +0000
Subject: Re: [SMARTY] Re: need help with executing own function
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12175@lists.php.net to get a copy of this message
maybe this thread i found linked off of boots' wiki page will help explain modifier plugins (it has a nice explanation of why you'd want to use them as well as sample code - which i presume works): http://www.phpinsider.com/smarty-forum/viewtopic.php?p=5750#5750 dan zuhaimi zainal had written:
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
802-863-5251 x156                 | http://nationalgardenmonth.org
-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


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