Function that creates a class instance with a given name

From: Date: Tue, 29 Jun 2004 11:16:16 +0000
Subject: Function that creates a class instance with a given name
Groups: php.general 
Request: Send a blank email to php-general+get-189220@lists.php.net to get a copy of this message
Hi there! I am trying to make a PHP function "create_object" that would allow me to create a class instance with supplied name Here's the Smarty code snipset I would like to use my function in: {* Let's create a new class object with name "car" *} {create_object id=$id_car name="car"} {* When it is created, we can print out its properties or do whatever we need to *} The brand is: {$car->brand} and car's color is: {$car->color} Any ideas how to create PHP function that would allow to create the instance so I can operate with it in Smarty as shown above? function create_object($id, $name){ //help needed } Thanks, Maris

« previous php.general (#189220) next »