PHP Classes


Recommend this page to a friend!
  Classes of Arash Soleimani  >  PHP JSON Form Builder  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP JSON Form Builder
Generate a HTML form definition in JSON format
Author: By
Last change: Update sample json for onChange and onClick
Date: 2 years ago
Size: 1,874 bytes


Class file image Download

JSON Form Generator

LeoMoon JFG generates HTML form tags from JSON file/input. JFG supports all types and attributes of form tags.


Companies change their software every couple of years. If they have too many pages and forms, they need to redesign the whole thing again. But when you are using JSON format, you don't have to worry about redesigning everything. You just write a new JSON render engine in a new programming language or framework. Here is an example:



  $form = new Form(['file'=>'./example_form.json']);

Sample JSON file

    "name": "formName",
    "title": "Registration form",
    "description": "simple JFG example.",
    "method": "post",
    "action": "",
    "properties": {
      "firstName": {
        "type": "input",
        "title": "First name",
        "value": "test",
        "required": true,
      "lastName": {
        "type": "input",
        "title": "Last name",
        "disabled": true
      "age": {
        "type": "number",
        "title": "Age",
      "bio": {
        "type": "input",
        "title": "Bio",
      "password": {
        "type": "password",
        "title": "Password",
        "min": 3
      "language": {
        "type": "select",
        "title": "Language",
      "submit": {
        "type": "submit",
        "title": "Save Form",
For more information send a message to info at phpclasses dot org.