Formbuilder

From RedBean

Jump to: navigation, search

Contents

A form builder in 12 lines

What can you write in 12 lines of code? Well as it turns out, a dynamic form writer belongs to the possibilities!

This form builder allows you to dynamically build forms. Open the url and fill in the name of the new form. Add fields and save the form with test data in each field (required). Now open the url again with the f-parameter indicating the form you want to present; voila, here is your form.

Features

  • Stores forms in separate tables
  • Allows you to use plain SQL to query form data
  • Unlimited number of forms and form fields
  • No reloads, uses fancy javascript to add new fields
  • Use FUSE to add models later on

Demo

This code demonstrates:

  • RedBeanPHP getColumns()
  • RedBeanPHP SQLite Automagical Setup
  • RedBeanPHP Cooker (new in RedBeanPHP 1.3)
  • Basic RedBeanPHP CRUD

The Code

Here are 12 lines of compact, but reasonable (less than 100 characters on a line) code. Total number of characters is about 760.

https://gist.github.com/952357

Personal tools