![]() 'inlineRadioLabelClass' => 'form-check-label', 'inlineCheckboxLabelClass' => 'form-check-label', 'horizontalOffsetCol' => 'col-sm-offset-4', 'horizontalLabelClass' => 'col-form-label', ![]() 'verticalRadioLabelClass' => 'form-label', 'verticalCheckboxLabelClass' => 'form-label', 'textErrorClass' => 'invalid-feedback w-100 d-block', 'formHorizontalClass' => 'form-horizontal', Default options (Bootstrap 5) $bs5_options = array( To add an input wrapper, see the addInputWrapper function. It can be done with elementsWrapper, checkboxWrapper, and radioWrapper. If needed, wrappers can contain two HTML elements. The form options allow us to configure it all efficiently. The $opt argument can be an option name, or an array of options names, or null if you want to show all the options keys => values.įor example, with Bootstrap, each group (label + element) has to be wrapped into a and to have a. You can call the getOptions($opt) function at any time to display the options and their values for debugging purposes. The Default options are for use with Bootstrap 5.Įach can be overwritten the way you want to match other framework The PHP Form Builder options define the containers and various HTML elements your forms will use. JavaScript dependencies can also be loaded with the excellent loadjs library.ĭetailed explanations are available here: Optimization (CSS & JS dependencies) Options Overview Efficiency is maximum, no matter how many plugins you use. Your page will, therefore, only call two dependency files. PHP Form Builder groups and compresses all the CSS and JavaScript dependencies into a single CSS | JavaScript file. Which considerably increases the loading time. Without PHP Form Builder, your page loads the plugin dependencies (CSS and JavaScript files) one by one.įor instance, if your form uses five plugins, you will need to call at least ten files (5 CSS + 5 JavaScript), General > Construct About optimization (CSS & JS dependencies) This style sheet only includes what is necessary to layout your responsive forms and will not break anything in the other parts of your pages. Tailwind $form = new Form('my-form', 'horizontal', 'novalidate', 'tailwind') UIKit $form = new Form('my-form', 'horizontal', 'novalidate', 'uikit') No frameworkĪdd the minimal Bootstrap 5 CSS to your page head, then you can build your forms with Bootstrap 5. $form->addPlugin('materialize', '#my-form') If your website uses Bootstrap 4 framework: ![]() $form = new Form('my-form', 'horizontal', 'novalidate', 'material') If your website uses Materialize framework: Pages created with Materialize or Bootstrap 4 can both include Material Design forms. Material Design forms are built with Materialize framework. Bootstrap 4 $form = new Form('my-form', 'horizontal', 'novalidate', 'bs4') Bootstrap 5 Default $form = new Form('my-form', 'horizontal', 'novalidate') Bulma $form = new Form('my-form', 'horizontal', 'novalidate', 'bulma') Foundation - v6.4 or higher, with XY grid $form = new Form('my-form', 'horizontal', 'novalidate', 'foundation') Material Design If none of the available frameworks powers your website, we provide a minimal version of Bootstrap 5 CSS to design your forms. *= End of 4th block =*/Īll options are ready to use and will generate HTML markup according to the chosen framework. $form->addBtn('submit', 'submit-btn', 1, 'Send', 'class=btn btn-success') $form->printRadioGroup('is-all-ok', 'Is all ok ?', false, 'required') Here is an example of a page containing a form: addInput('text', 'user-name', '', 'Name :', 'required, placeholder=Name') The fourth block just before to call required js files and js code to activate plugins.The third block in section to render your form.The second block in your section to call required css files for plugins.The first block at the very beginning of your page to include Form.php and build the form.To build and display your form, you have to include four PHP code blocks: Then add your fields and render the HTML code with the help of the functions detailed in this document. ![]() Instantiate your forms by creating an object with $form = new Form(). The PHP Form class is the core of the system.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |