[Typo3-dev] RFC Forms, validation, etc. in 5.0

Kasper Skårhøj kasper2005 at typo3.com
Mon Nov 21 08:01:43 CET 2005


Good morning, Michael,

thanks for your suggestions, especially the "PS" in your mail woke me up ;-)

I agree with your general goal; TCEmain and TCEforms are huge. I think in 
version 5.0 we might redesign them completely (I mean; the refactoring would 
be so heavy that it is not refactoring anymore :-). Actually I wanted to 
improve them for version 4.0 already but realized that to finish the 
workspace features I better keep my focus because starting the redesign would 
be a 3-month project.

Anyway, the approach I have been thinking of is to center forms generation, 
validation etc. around data objects. 

Today we do:

$row = ....SELECT * FROM table WHERE uid=123
print $row[$TCA['table']['ctrl']['title']]

Tomorrow we do:

$rowObj = new dataObject(table, uid)
print $rowObj->getTitle()

The data object can also be used like this:

$rowObj->setField('title', 'My new title value');

or:

$rowObj->getFormElement('title');


As you can see the data object is the interface to updating, rendering forms, 
reading out data, basically anything. And the data object knows its own TCA 
structure (we might call it something different in the future).

Internally, there are of course other objects which do the actual form 
rendering, validation etc., possibly by some design pattern which allows the 
flexibility we need to use such objects at other locations separately - or 
simply exchange them with something customized. 

Finally it should work the same in frontend and backend.

These are just my sketches for now. I'm not at all settled on a specific 
solution, just wanted to let you know we are thinking in very alternative 
direction. But it is long term and not something that will happen tomorrow 
(5.0 this means, at earliest!)

Have a nice week, Michael!

- kasper




More information about the TYPO3-dev mailing list