question about making modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux