[TYPO3-core] RFC #9879: enable charlist for trim function in stdWrap

Steffen Kamper info at sk-typo3.de
Thu Dec 4 14:26:08 CET 2008


Hi,

Dmitry Dulepov schrieb:
> Hi!
> 
> Steffen Kamper wrote:
>> well, that would lead that a bit to absurdum (double trim).
> 
> What is the problem with double trim? Inner trim trims '|' characters and preserves spaces. Outer trim trims the content. It is very logical and simple. One single line of code and all is done.
>

no real problem, just the reverse of the original php-trim (with 
charList there is no whitespace-trim)

>> What if we allow specialChars like in regEx?
>> \s = space
>> \n = linebreak
>> \t = tab
>> etc
>>
>> so it's possible to only trim * without whitespace trim.
> 
> It means this simple functionality becomes more complex in both code and TS.
> 
> Firsts, it means more complex parsing for $conf['trim.']['charList']. Why is that necessary?
> 
> Secondly, why force people to remember that \s means space? Not everyone is a PHP programmer. | *| is familiar because exists in noTrimWrap. \s* is not familiar for non–PHP people. System should more simple and friendly, not complex and cryptic.
> 
> In fact, existing version of the patch allows space, tab and even line break (using ")" syntax). What's the point to make it more complex?
> 

i only think loud. Ok, there is the noTrimWrap-syntax, but until now 
it's not possible to use tab or line break in TS.
This was just a thought to make it general availble in TS. It doesn't 
make it really complex, as in php the input string can easy be replaced 
(\s => ' ' ...) and it would be available for all properties.

So it's notbind to this RFC, just a general idea.

vg Steffen


More information about the TYPO3-team-core mailing list