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

Dmitry Dulepov dmitry at typo3.org
Thu Dec 4 15:22:38 CET 2008


Hi!

Martin Kutschker wrote:
> Here's a syntax version without | but with a magic whitespace attriburte:
> 
> lib.fo = TEXT
> lib.fo {
>  value =  * Hello World *
>  trim = 1
>  trim.charList = *
>  trim.charList.trimWhiteSpace = 1
> }

It is an option but also more complex than | *| because of the extra property :) With current patch you can do:

trim.charList = *
	or
trim.charList = | *|
	or
trim.charList = |*|

It is one construction as opposed to two.

I like that "|" syntax because it is already familiar to users. It is one of HCI principles: to use concepts familiar to users.

> And here's yet another one where charList is a comma separated list and
> any number is meant to be a code point (note that you have to use code
> points if you want to trim number!):
> 
> lib.fo = TEXT
> lib.fo {
>  value =  * Hello World *
>  trim = 1
>  trim.charList = *,32
> }

One note: it adds hidden limitations: comma or digit characters cannot be trimmed. The use case to trim comma is to make "1,2,3,4," valid for SQL "IN".

-- 
Dmitry Dulepov
TYPO3 core team
In the blog: http://typo3bloke.net/post-details/zend_debugger_goes_64_bit_on_mac_os_x/
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book


More information about the TYPO3-team-core mailing list