Re: constructing class

From: Date: Wed, 01 Dec 2004 15:42:53 +0000
Subject: Re: constructing class
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-203229@lists.php.net to get a copy of this message
* Lorderon <ighen@zahav.net.il>: > I want to create an instance of a class and construct it with different > params. The class name is a variable and the params change in each class. Is > there a way to pass params to the constructor of a class like you pass > params in the function call_user_func_array() ? Why don't you just pass an associative array as the second argument? Then you can have each class' constructor figure out what it needs from the array. -- 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

« previous php.general (#203229) next »