[TYPO3-core] Hook names

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Sep 23 09:51:19 CEST 2013


Philipp Gampe schrieb am 21.09.2013 18:46:
> Hi all,
> 
> 
> looking into 
> https://review.typo3.org/#/c/23922/2/typo3/sysext/frontend/Classes/Page/PageRepository.php 
> I wonder if we have any naming conventions for hooks.
> 
> We cannot change old hooks (unless we introduce yet another compat layer), 
> but we should try to not repeat the old problems again, especially we should 
> not include the file name in the hook name.

True. Something needs to be defined here.

> I prefer hooks with a clear name that describes what the hooks does or 
> offers. Thus in the above example I would go for pageInitPostProcess.
> 
> What do you think?

I think that it should at least be namespaced somehow to avoid clashes.
"pageInitPostProcess" could be a hook name in an extension too. Or one
for the "Web>Page" module.

We already have XCLASS definitions in
$TYPO3_CONF_VARS['SYS']['Objects'][<classname>], why not use some
similar construct for hooks:

$TYPO3_CONF_VARS['SYS']['Hooks'][<classname>][<hookname>] ?

Or even at "top level" ($TYPO3_CONF_VARS['Hooks']) to avoid so much
clutter of the SYS section.

Cheers,
Ernesto



More information about the TYPO3-team-core mailing list