Jump to content

Recommended Posts

Hello,

 

I working on my form class and I divided it into three subsections. FormParser, FormBuilder and FormValidator.. Before I go deeply I want to ask some questions in my mind.

For the form system, I decided to use xml and yaml files including all the form data.

For example, sample xml file,

<form id="frmNewMember" action="#" method="post">

<input type="text" name="username">

<rule minlength="3" />

</input>

...

</form>

 

FormParser class will parse the data from xml/yaml files and store it in an array.

FormBuilder class will generate html forms visually using the data in array.

FormValidator class will make the validation.

 

1) What's do you think about the system in general? This class will be a part of my future framework so I want to use xml/yaml files to seperate form views from the code.

2) Should I divide my form class into parts? (Like FormParser, FormBuilder and FormValidator) or should it be one file?

3)I don't know much about XSL and XSLT? Can it be used for the FormBuilder part?

 

I can make some mistakes in the development process. I would be grateful, If you could show me a way to design a better system.

 

Thank you..

 

Link to comment
https://forums.phpfreaks.com/topic/85214-form-class/
Share on other sites

I think your ideas are pretty good. One thing I would suggest is that you design everything on paper first. Create requirements for what each class should do and a document describing how they should interact... you can then fill in the details when you code. It's much easier to make changes on paper than in code.

 

That being said, I have mixed feelings on the formbuilder component of your framework. I've often thought the same, but what I'm trying to do is truly isolate the design (formbuilder) component from the PHP code and logic. If you expect non PHP guys to use your framework, then they should not have to understand or deal with PHP in any way. If you can keep the design as almost entirely HTML+CSS you can allow a designer to provide that to you and easily plug it into your system. Just some food for thought. I guess my only suggestion is to really give some thought as to how you might minimize any constraints/learning curves for designers. Let coders code and designers design. You should not have to mix the two.

 

Goodluck and continue posting your thoughts and comments. I always enjoying looking at new ideas and design thoughts. That's why this is the forum I'm most active in :)

Link to comment
https://forums.phpfreaks.com/topic/85214-form-class/#findComment-434763
Share on other sites

Let coders code and designers design. You should not have to mix the two.

 

While this is kinda true, it is not totally, there si always a mixture of the two is a small way at the minimum.  All designers should have a basic understanding of programming by at least knowing how to print variables and do control statements Since that is something you can never fully take out of the "view" files, I mean you still have to do them with template systems(Which I think are utterly pointless is using an MVC Pattern).  Also, on a side note, it is just the same where developers(or Coders) should also have a basic understanding of css too,it is not one sided

Link to comment
https://forums.phpfreaks.com/topic/85214-form-class/#findComment-438774
Share on other sites

I think you're missing the point.

 

Yes there is going to be the need to insert variables and sometimes some custom logic for loading dynamic content (views), however you should not (IMO) be developing a system that would require a designer to write PHP code in order to generate an HTML form.

 

Worst case scenario the designer should provide you static HTML and CSS, which the developer just plugs in any calls for dynamic content.

 

By doing this I don't have to know (or care) what the CSS does, and they don't have to worry about what the PHP code does. If you do - great. But the dependency is not there.

 

Side note: If the system is only going to be used by you, and you are the designer and the developer, and this makes it easier for you... go for it.

Link to comment
https://forums.phpfreaks.com/topic/85214-form-class/#findComment-438916
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.