PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ovidiu Bokar   Simple Form Maker   index.php   Download  
File: index.php
Role: Documentation
Content type: text/plain
Description: Form class demo calls
Class: Simple Form Maker
Generate for HTML form inputs
Author: By
Last change: replace _instance with getInstance()
Date: 9 years ago
Size: 1,645 bytes
 

Contents

Class file image Download
<?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();