help with some class problem

From: Date: Wed, 19 Jun 2002 08:42:07 +0000
Subject: help with some class problem
Groups: php.general 
Request: Send a blank email to php-general+get-102893@lists.php.net to get a copy of this message
Hi! i'm making some modular aplication. I have one base class for example: class Main { function loadmod($name,&$mod) { $mod = new $name; // load module } } In module class i want to use some properties from main module, but i don't know how to solve this. But i don't want extend all module from main class, i call modules like this. first i initialize main class $main = new Main; $main->loadmod('testmodule',$m); and when i wan't to call some function from it i call $m->modulFunction(arg); i also don't know if this is right way to do this, but my point is that i want to have some main class on wich i buld modules, this modules use some properties en methods from main class like dbacces, configuration .... And also i don't want this to be slower everytime i add ne module. any ideas -- bye, Uros mailto:uros.gruber@sir-mag.com

« previous php.general (#102893) next »