Date: 01/03/01
- Next message: Matt Friedman: "[phplib] php4.0.4 and phplib template problems."
- Previous message: Marko Kaening: "Re: [phplib] HELP: oohforms"
- In reply to: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Next in thread: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Reply: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Jeroen Laarhoven schrieb:
>
> > OOHForms is hampered by the fact that it was written by someone else and
> > then moved into phplib. Ulf is writing a new Forms library to solve some
> > of the interoperability problems and make it a lot cleaner, hopefully this
> > will make it more robust too :)
>
> OOHForms like FastTemplates origine from Perl wizards and if you tried Perl
> you know why you should like PHP ;P and more important why management likes
> PHP. One reason is that others can understand, so maintain, your code :).
The original OOH Forms are not that bad as it seems. The basic idea of
an object oriented approach (central form object that controls form
element objects) is great but the code is somewhat tricky. It took
Kristian half a day and me two days to understand how it works. Most
confusing is marshal_dispatch(). Don't ask my what it does I already
forgot it.
The rewrite is not much better as the old code. The scenario is simply
to complicated for the average PHP beginner to understand it in detail.
Lots of scripters have problems to understand the concepts of OOP.
Although I tried to write straight forward and simple code some new
features make it look complicated. For example you can now set a "name"
and a "elname" property for every form element. This is helpful with
radio buttons. A group of radio buttons shares the same HTML name. To
access one of them you might want to give them a symbolic name that you
can use in your PHP script.
Another point of confusion might be the new JavaScript routines. This is
the input the complex version gets:
var _jsname = new form("jsname", ["pass", ["l", 5, 20, "A password must
have 5 to 20 characters."], "l",
"numbers", ["l", 3, 100, "Enter at least 3 numbers.", "r",
"^[0-9]+[\.,]?[0-9]*$", "", "Only numbers are allowed, no other
characters."], "lr",
"secret_numbers", ["l", 3, -1, "Enter at least 3 numbers.", "r",
"^[0-9]+[\.,]?[0-9]*$", "", "Only numbers are allowed."], "lr",
...
And here's the JS source...
http://phplib.netuse.de/cgi/cvsweb.cgi/php-lib/php/form/form_js_simple.js
http://phplib.netuse.de/cgi/cvsweb.cgi/php-lib/php/form/form_js_complex.js
The with all abstractions it gets more and more complicated the higher
the level of abstraction gets. For example the assistant/wizard controls
objects (tpl bridge) that control objects (form) that control objects
(form_elements).
Don't know if it's this way is really the best way we can go on the form
issue, but it's the most practicable I have seen.
> I guess his form stuff will be the same, so why no try that first?
Sorry, currently no docs (beside PHPDoc) and no support. It's no longer
alpha but still beta code.
Ulf
-- Ulf Wendel, NetUSE AG Siemenswall, D-24107 Kiel Tel: +49 431 386 436 00, Fax: +49 431 386 435 99--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>
- Next message: Matt Friedman: "[phplib] php4.0.4 and phplib template problems."
- Previous message: Marko Kaening: "Re: [phplib] HELP: oohforms"
- In reply to: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Next in thread: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Reply: Jeroen Laarhoven: "Re: [phplib] HELP: oohforms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

