[TYPO3-ect] Again: Forms library

Elmar Hinz elmar07 at googlemail.com
Mon Oct 22 17:44:37 CEST 2007


Hello,

time to reopen this theme.

Do you sometimes wonder, why there isn't a really good forms library
available for PHP, although PHP is that many years old by now? I often do. 

Google.com gives me an ECTs wiki page as 5th result for the search "php
forms library". No joke. That is funny and sad at the same time. Other
languages overtake right and left. Just think of the modern JavaScript
frameworks. 

Is it that difficult to write a forms library? I don't think so. Kasper
wrote 2 of them. One for the BE, the TCE Forms, but they are not usable for
FE plugins. The second, the TS forms, are for the FE, but they are not
object orientated, so that the are unflexible in the field of plugin
development.

The core team modernizes the forms element by now. Who knows details? Will
it be object orientated?

I meanwhile have made up my own vision of a forms library. It  should be
useful inside and outside TYPO3. There would be an object tree that
represents the forms structure and data, but no rendering data at all. The
rendering would be the task of independent renderers. (It could be
orientated on the XFORMS specification).

Because it doesn't contain rendering informations, it is rather simple to
code. The second advantage is, that you could choice between different
tools, to output the form to differnt formats.

Also the construction would be simple. It would be generated from a
typoScript or XML setup. Finally the population with data is straight away.
The data finds it's places by the name/id that every form element has. You
don't have to fiddle with the structure of the tree at all. It would simply
take an array or object like piVars. 

To summarize: 

The usage has three steps:

1.) Automatic tree object tree creation: 

  From a setup with TS or XML or PHP array. Could evalute the TCA.
  It's a real object tree that can be extended, processed etc. 

2.) Populating the tree with data:

  Array or object with id/names as index.

3.) Rendering the tree to output:

   Could be simply rendered to a form as a whole.
   Could be placed piecewise by ids into templates like smarty.

What do you think about? Does anybody take up the spark to light a firework?

Regards

Elmar





























More information about the TYPO3-team-extension-coordination mailing list