[TYPO3-core] RFC: #9602: hook in tslib_fe::contentStrReplace isn't flexible enough
Ernesto Baschny [cron IT]
ernst at cron-it.de
Tue Oct 21 14:44:53 CEST 2008
Steffen Kamper wrote: on 18.10.2008 15:34:
> this is a SVN patch request.
>
> Branches: trunk
>
> BT reference: http://bugs.typo3.org/view.php?id=9602
>
> Problem:
> The Hook in tslib_fe::contentStrReplace uses an array with $search and
> $replace which is good for simple replace like
> $params['search'][] = 'typo3';
> $params['replace'][] = 'TYPO3';
>
> For the case you want to replace more complex stuff it can't be done
> this way.
> For Example if you have a cached page and you want to output
> click-counter of items you need to search with reg. expressions, fetch
> the record and replace it with the field value.
>
> In this case it's easy to pass the content too without changing the
> count of parameters in the hook, so it's 100% backward compatible.
> Once the content is passed you have the freedom to do any complex
> operation with it.
>
> I did this with the attached patch.
To clearify what Oli already stated, the additional $param is not
needed, as the called hook already have access to $this. So this patch
is not really needed. Please close the issue (also in the bug tracker).
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list