[TYPO3-core] RFC: Feature Request #9078: Integrate hook in page module to render preview of records with own CType

Oliver Hader oliver at typo3.org
Wed Aug 13 15:32:55 CEST 2008


Hi,

Steffen Kamper schrieb:
> Dmitry Dulepov [typo3] schrieb:
>> Hi!
>>
>> Oliver Hader wrote:
>>> I'm using this new hook to render the previews for individual CTypes 
>>> as well as for previews of the standard CEs that were extended by 
>>> some IRRE functionalities (nested child records with additional 
>>> content).
>>
>> The question is: is it necessary to use getUserObj and hard-coded 
>> names? Sometimes different hooks are good to have in one class. Having 
>> free naming for hook gives more implementation freedom. I prefer 
>> t3lib_div::callUserFunction instead of getUserObj and hard-coded 
>> function name.
>>
> 
> +1 for generalize that.
> 
> t3lib_div::callUserFunction is the best, easy to use, and it would make 
> sense if all hooks are called the same way.
> 
> Now we have 3 different kinds of hooks, which makes it not easy for a 
> developer.

This means that we would declare the interfaces for hooks that have been 
introduced in TYPO3 4.2 to be obsolete. Well, I don't like the idea of 
completely throw away such things.

The disadvantage is that new functionalities in an interface class, such 
as new/forgotten function arguments or new functions will cause old hook 
implementations to fail.

The advantage of the interface/getUserObj method is, that there is a 
well defined description how the hook must be implemented. This also 
means that hooks and their parameters could be documented automatically 
and that an error handling could do something if a hook does not 
implement the interface.

I guess that there also was a discussion when the first hook using an 
interface had be posted as RFC to the core list. Maybe we should search 
and re-read it.

olly
-- 
Oliver Hader
TYPO3 4.3 Release Manager


More information about the TYPO3-team-core mailing list