Menu

#2 Improvments ?

open
nobody
None
5
2002-06-28
2002-06-28
No

I use phpObjectForms to make my backoffice,
congratulations it's very usefull ;)
I had to adapt it for my site, maybe this could give you
ideas to improve POF :

1. I work with templates (class FastTemplate), so
instead of printing directly the HTML code with
an "echo" command, I put it in a string variable that I
can parse in a template tag. If you want to see the form,
and only the form you can do a print() to see it, but you
decide when.

2. Maybe more specific to my project : I have two
profiles of users, one who can modify data (admin) and
one who can just see them (onlooker) so I thought to
make a sort of "inactive" mode. To do that, I added a
boolean variable in the FPForm class, "active":
- when "active" is true, I print the form "normally"
- when "active" is false, I just print the default values of
the forms without <form> nor <input> HTML tags.
This allows me to factorize code easily.

This 2 modifications seem to work well: I spent time to
make them but now I avoid wasting time doing many
times the same things.

I had a third idea that I didn't implement : Maybe the
form could report which field have been changed after
submit ?

Please tell me if you are interested in these adaptations.
Julien.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB