[TYPO3-dev] tslib_fe-contentStr-hook

Steffen Kamper info at sk-typo3.de
Fri Oct 17 18:59:08 CEST 2008


Hi Dmitry,

Dmitry Dulepov schrieb:
> Hi!
> 
> Steffen Kamper wrote:
>> when i use the tslib_fe-contentStr-hook i can do simple search/replace 
>> adding them to the array. The function in tslib_fe uses str_replace.
>>
>> What i need is search/replace with reg. expression, eg
>> search for ___UID:123___
>> where i fetch record with uid 123 and replace the complete one with 
>> content of a field.
>>
>> Is there another way to do it?
> 
> I did not understand what the problem is but if you want to replace 
> using regular expressions, you always can use preg_replace.
> 

the problem is that in the hook i only have the array where i can add a 
search and a replace string like
$params['search'][] = 'typo3';
$params['replace'][] = 'TYPO3';

The replace is in tslib_fe after the hook and makes a simple str_replace 
with both arrays. But for the example above this doesn't work.

vg Steffen




More information about the TYPO3-dev mailing list