PHP Classes

Simple Form Maker: Generate for HTML form inputs

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 663 All time: 4,862 This week: 488Up
Version License PHP version Categories
simple-form-maker 1.0.3The PHP License5.0HTML, PHP 5
Description 

Author

This is simple class to generate for HTML form inputs.

It can generate HTML for a form and several types of inputs and form elements like buttons, text areas and labels.

The class takes arrays of parameters that define the attributes of each form element and includes the attributes in the tag HTML that is returned as a single string.

Picture of Ovidiu Bokar
  Performance   Level  
Name: Ovidiu Bokar <contact>
Classes: 2 packages by
Country: United Kingdom

Documentation

<?php include 'FormMaker.php'; ?> <?php /** * @file * Form maker * * @copyright Copyright (C) 2015 OSb Web Solutions * @author Ovidiu S Bokar <contact@osbwebsolutions.com> * @date 24/02/2015 * */ /* The below code will create: <form method="POST" name="Lipsum" class"form-class" id="form-id"> */ $formOptions = array( 'method' => 'POST', 'name' => 'Lipsum', 'class' => 'form-class', 'id' => 'form-id', ); FormMaker::getInstance()->form_open($formOptions); /* The below code will create: <label class="my-label-class">My Label Name</label> */ $labelName = "My Label Name"; $optionLabel = array( "class" => "my-label-class" ); FormMaker::getInstance()->form_open($labelName,$optionLabel); /* The below code will create: <input name="input-name" class="my-input-class"> */ $optionInput = array( "name" => "input-name", "class" => "my-input-class", ); FormMaker::getInstance()->form_input($opstionInput); /* The below code will create: <textarea rows="5" cols="60" class="my-textarea-class"></textarea> */ $optionTextarea = array( "rows" => 5, "cols" =>60, "class" => "my-textarea-class", ); FormMaker::getInstance()->form_textarea($optionTextarea); /* The below code will create: <button class="my-button-class">Click here!</button> */ $buttonName = "Click here!"; $optionButton = array( "class" => "my-button-class", ); FormMaker::getInstance()->form_button($buttonName,$optionTextarea); /* The below code will create: </form> */ FormMaker::getInstance()->form_close();

  Files folder image Files (2)  
File Role Description
Plain text file FormMaker.php Class Form Class
Accessible without login Plain text file index.php Doc. Form class demo calls

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:663
This week:0
All time:4,862
This week:488Up
User Comments (1)
This is a good and useful class ;-) If You provided one examo...
10 years ago (José Filipe Lopes Santos)
60%StarStarStarStar