[TYPO3-dev] Extending classes on demand

Johannes Reichardt typo3 at gramba.de
Mon Aug 28 22:48:33 CEST 2006


Hi there,

i have a few questions regarding php, classes, extending and that 
related to typo3 also.

Right now i struggle with a construction like this:

class tx_xy {
    function foo() {
        require_once('class.tx_xy_extended.php');
        return $this->foo_extended();
    }
}
in seperate file:

class tx_xy_extended extends tx_xy {
    function foo_extended() {
       return 'damn oop shit';
    }
}

echo tx_xy::foo();

this does not work for many reasons - the most annyoing problem is the 
problem that the $this-> thing doesnt work as expected. Does anybody 
know how to overcome such limitations? This could also be a key
in desiging typo3 5.0 so only the really needed stuff is loaded? Any 
opinions or hints here?

- Johannes









More information about the TYPO3-dev mailing list