[TYPO3-dev] SOLUTION (?) : Multiple XCLASS inheritance

Jerome Schneider typo3dev at ameos.com
Wed Feb 8 12:10:50 CET 2006


Hello Bernhard and Elmar,
I think you've understood the principles of what I'm trying to say ( my 
english isn't perfect ;)

I made this document to explain in details the idea : 
http://www.ameos.com/index.php?id=244

Hope this answers to your questions. If it does or not, please just let me 
know :)

Regards
Jérôme Schneider

"Elmar Hinz" <elmar.DOT.hinz at team.MINUS.red.DOT.net> a écrit dans le message 
de news: mailman.1.1139354519.1405.typo3-dev at lists.netfielders.de...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Bernhard Kraft schrieb:
>> Jerome Schneider wrote:
>>
>> Hi !!!
>>
>> I think I tortured my head for days thinking about how there would be a 
>> way to
>> "merge" methods of overruling "Y"CLASSES :) with a base class. This can 
>> be done
>> in OO programming languages using a decorator pattern AFAIK.
>>
>> But I couldn't think of any way how to do this in PHP.
>>
>> I tried a little bit around if it would be possible to have variable 
>> names as
>> class names like
>>
>> $class = 't3lib_TCEmain';
>>
>> class $class {
>>
>> /* methods go here */
>>
>> }
>>
>> but PHP didn't like that :(
>>
>
>
> I didn't try this myself. Just an idea:
>
> $class = 'xyImplementationOfBaseClass';
>
> eval('class baseClass extends '. $class . ' { }');
>
> class myClass extends baseClass{
>
>   [.....]
>
> }
>
> Maybe you need to include a file myClass.php after eval is done to prevent 
> parse
> errors.
>
>
> /el
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFD6SuLO976RNoy/18RAqiyAKCTbeIGjMx17LrOEtT4Jz62WOTKJQCgljOr
> YeAokfefNDa6XChN40s6Glw=
> =P7AZ
> -----END PGP SIGNATURE----- 






More information about the TYPO3-dev mailing list