[TYPO3-core] RFC: eval API (#1639)

Michael Scharkow mscharkow at gmx.net
Fri Nov 18 10:48:19 CET 2005


Sebastian Kurfuerst wrote:

> Sometimes it would be useful to add special evaluations to be used in
> TCEforms. As an example, if the user needs a special date evaluation in
> the BE, he currently has to XCLASS the evaluations and add some custom
> JS. To make this more clean, an eval API would be nice.

Hi Sebastian,

the patches look good although I didn't look into the extension.

>       * every evaluation has a JS part and a (possible) PHP part, as
>         usual

Let's say *all* eval (or validation) classes must have a PHP part and 
possibly a JS part. Rationale: Validation is needed everywhere in 
TCEMAIN because it belongs into the model (in MVC speak), so it must be 
available as php classes (or rather static methods) as we can rely on 
that. JS validations are clumsy because a) JS sucks, b) users can 
disable JS.

Ideally, I'd like to get rid of JS validation altogether because it 
violates the DRY principle to have a PHP and a JS function to maintain. 
With AJAX we can call *any* php eval function in JS, as seen in

http://particletree.com/features/degradable-ajax-form-validation/

So yes for now, and let's do it better in 5.0.

Greetings,
Michael

PS: I'll write up on this in -dev.



More information about the TYPO3-team-core mailing list