After the previous update to the Form Builder, it was mentioned to me that the placing of each element in it’s own div was no longer required. This update removes those divs and just causes the straight HTML to be returned from the toHTML functions.
After using the Form Builder, I realized that one part of how it was originally implemented made it extremely hard to use. This has now been fixed.
Instead of returning a string of the output from the actual object, the output is split into two sections:
- FormBuilder::HTML – The HTML for the actual input element
- FormBuilder::LABEL – If a label is present, the label part of the input field
Made the class valid with PHP Strict.
There used to be a binding issue when binding integers would throw a Strict error, this issue has been resolved.
Through use further use of MiniMVC and the Form Builder, I have noticed there were a few bugs in them.
MiniMVC the error handling wasn’t working correctly, so it has been fixed.
Form Builder was missing functions for setting CSS classes for the labels, so these (addLabelCSSClass, getLabelCSSClass) have been added in. These take the same parameters as the functions which are similar for the fields (addCSSClass, getCSSClass).
These updates are encouraged as they help to support the core functionality of the application.
I have completed a preliminary version of a form builder. It will allow you to programmatically build forms which can be send in from the controllers to your views so that you never have to worry about different views handling the information in different ways (or changing names or anything).
I will be posting links to the documentation soon so that all of the built-in features will be displayed. Just because you are doing things programmatically doesn’t mean you can’t stylize nor have valid HTML. You can add as many attributes to the input types as you want (including specialized ones for adding CSS classes and styles).
Please Note: In this version of the form builder, arrays of fields are not permitted (i.e. they will overwrite each other). I am actively working to remove this limitation as soon as possible.
Along with the form builder, I have uploaded a small update to the Mini MVC base engine (just a little clean up thing).
Tiny update. Now the body can be pushed through the layout folder as well.
If you know that a file will never exist in the layouts folder, you can include LayoutManager::BYPASS => true in the array passed into each of the arrays for the __loadViews function and it will skip the extra searches.
While implementing a new plugin, I realized that the original folder situation for the app/config/ folder would get awful messy fairly quickly. I have done a quick update just to rearrange the folder hierarchy to clean it up a little more.
Sorry for the inconvenience.