Re: [SMARTY-DEV] Resolution on static methods?

From: Date: Sat, 22 Feb 2003 12:19:16 +0000
Subject: Re: [SMARTY-DEV] Resolution on static methods?
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-818@lists.php.net to get a copy of this message
Show me some explicit examples what you want to do with it in the templates.
Sure. I often use static methods to share functionality between code and templates. These methods _could_ be rewritten as modifiers or functions for the templates, but that would make the methods inconvenient to use in regular PHP code. Or I would have to write a wrapper as a modifier or function, which is also inconvenient. Simple example: Location::getZipCode($city); Which could be nicely used either directly in the templates as {Location::getZipCode("Los Angeles")} or in PHP code for further processing. -- David Heinemeier Hansson http://www.loudthinking.com/ -- Broadcasting Brain

« previous php.smarty.dev (#818) next »