Re: Classes - Dumb question
| From: | tedd | Date: | Sat, 13 Oct 2007 03:39:12 +0000 |
| Subject: | Re: Classes - Dumb question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263173@lists.php.net to get a copy of this message | ||
At 2:44 PM +0100 10/12/07, Stut wrote:
You can limit the need to add more code like so...
function customer($whatWas, $customertype, $whatAdditional)
{
/* do "what was" (i.e., common to all) */
/* then do what's additional unique to type */
$func = strtolower($customertype).'Customer';
$func($whatAdditional);
}
That's something I haven't seen before (in this language) -- that's slick.
Thanks,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com