newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Project rewrite #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sorry to contact you through the issue tracker. 

I had a need for a dynamic form generation class and stumbled across your 
project. I was very impressed with the feature set and the look of the forms 
that it generates. 

There were issues, however, with my particular implementation. As I dove into 
your code to try and adjust things to fit my installation I realized that the 
code is (no offense) completely unmanageable. It's actually quite difficult to 
dive into and get a good sense of how things are glued together. 

I notice in the latest version you've released you've put a lot of effort into 
implementing php 3 namespaces. This was attractive but not suitable for my 
mixed environment. 

I actually began a rather lengthy rewrite of the code using DOMDocument to 
generate the form and it's elements. Most of this work was done by reversing 
the HTML source of your example forms. 

This has enabled me to fold everything into one class. The current state of the 
code is missing quite a bit of the functionality your code currently has but 
this will be an ongoing effort on my part (I'm a complete idiot when it comes 
to javascript and design). 

I wanted to reach out and make my current code available for your 
consideration. If you're not interested, cool. If you are, let me know if 
you're interested in the design change and I can work with you to complete all 
missing functionality.

Original issue reported on code.google.com by lordny...@gmail.com on 6 Mar 2011 at 2:32

GoogleCodeExporter commented 8 years ago
Thanks for your feedback.  I'd enjoy seeing what you've put together.  Please 
feel free to attach your code within this issue tracker.

- Andrew

Original comment by ajporterfield@gmail.com on 6 Mar 2011 at 7:05

GoogleCodeExporter commented 8 years ago
The biggest problem I had with the implementation is the inability for the 
class code to live outside of the document root. Additionally, I wanted to use 
Smarty for rendering the CSS and JS code. I removed as much of the inline 
html/css/js as possible. I wanted to make sure the users of my CMS had the 
ability to modify the visual aspects of the form in CSS only. 

You'll notice in each function I'm pushing all tag info to a class 'form meta' 
array. Currently, this does absolutely nothing and I'm considering removing it 
entirely. The reason I stuck it in was to have the ability to write a smarty 
plugin that renders the form base based on the form meta array instead of 
trying to traverse the DOMDocument in template code. 

I'm still struggling with the js and css bits (I have extremely limited js 
experience). Currently I'm passing css and js info in _SESSION like you, but 
I'd like to remove the dependency on sessions as well. I'm just not sure if 
absolutely has to be that,  I noticed in your comments somewhere you wrote that 
the js include has to be asynchronous because of the xhtml spec or something. I 
haven't quite figured it out. 

Let me know if you have any questions or comments. 

Original comment by lordny...@gmail.com on 6 Mar 2011 at 11:57

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ajporterfield@gmail.com on 14 Mar 2011 at 3:13