[TYPO3-dev] Sensible usage of hook tslib_content_getDataHook or not?

Francois Suter fsuter at cobweb.ch
Mon Sep 8 18:17:46 CEST 2008


Hi all,

In one of my extensions I need to access some extra data inside a 
getText function. One possibility is to put my stuff into $GLOBALS and 
get it with a syntax like:

someproperty.stdWrap.data = global:MYSTUFF|index1|index2

This works ok, but I was wondering if stuffing things into $GLOBALS was 
such a good idea.

Another possibility is to put my stuff in a more special place (like in 
the current instance of tslib_content that I'm using) and extracting it 
using the tslib_content_getDataHook hook that is in 
tslib_content::getData().

This seems cleaner but has the drawback that the hook gets called every 
time getData() is called, which seems like an important overhead to me.

Any opinions on this?

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch




More information about the TYPO3-dev mailing list