question about making modules

From: Date: Sat, 01 Sep 2007 21:23:31 +0000
Subject: question about making modules
Groups: php.general 
Request: Send a blank email to php-general+get-261605@lists.php.net to get a copy of this message
Hey, i've been trying alot to make php modules (php based.. not real modules for php in c) but i can't get it working. Here is a sample file: <?php class moduletest { function text() { return "moduletest<br />"; } } class test_moduletest extends moduletest { function text() { return "test_moduletest<br />"; } } $test = new moduletest; $test2 = new test_moduletest; echo $test->text(); echo $test2->text(); ?> Now what you get when running this file: moduletest test_moduletest That's logical and not the problem The issue is that i want the test_moduletest class to overwrite functions in moduletest but without the need for me to call the class again. So the result i want with $test->text(); == "test_moduletest" and $test must initialize the moduletest class!! not the test_moduletest class. I want to use this as a (obvious) module system so that others can extend the base class with more advanced features or improve existing features by overwriting them. i did found a place where this is being done: "ADOdb Lite" but i can't find out how that script is doing it.. Any help with this would be greatly appreciated Thanx, Mark.

« previous php.general (#261605) next »