[TYPO3-seminars] xclassing class.tx_seminars_pi1.php

Krystian Szymukowicz t33k.RE.MO.VE at RE.MO.VE.prolabium.com
Fri Feb 19 13:38:13 CET 2010


Oliver Klee wrote:
> Hi,
> 
> Krystian Szymukowicz schrieb:
>> hi
>>
>> I can not xclass class.tx_seminars_pi1.php.
>>
>>
>> What I did so far is:
>>
>> a) in ext_localconf.php
>>
>> $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/seminars/pi1/class.tx_seminars_pi1.php']=
>> t3lib_extMgm::extPath($_EXTKEY,'ext/seminars/pi1/class.ux_tx_seminars_pi1.php');
> 
> You have a typo there:
> 
> ($_EXTKEY,'ext/seminars/pi1/class.ux_tx_seminars_pi1.php')
> 
>   ->
> 
> ($_EXTKEY) . 'ext/seminars/pi1/class.ux_tx_seminars_pi1.php'
> 

Tnx. Indeed it was unintended typo.

But I did check why it worked anyway. It turns out that static 
extPath($key, $script = '') has the second parameter that is added to 
the path. So it worked as expected.



>> b) in the class.ux_tx_seminars_pi1.php there is:
>>
>> class ux_tx_seminars_pi1 extends tx_seminars_pi1 {
>>
>>   //xclassed method
>>   private function createSingleView() {
>>     ...
>>   }
> 
> You can only overwrite public or protected methods, not private methods.


Thnx. I was not aware of that. Indded I tested that changing to 
protected allows xclassing.

Finally i turns out that hook "modifySingleView" will do the job here.



Many thanks for your support.


--
grtz
Krystian Szymukowicz


More information about the TYPO3-project-seminars mailing list