Download the PHP package burntcaramel/perforated without Composer
On this page you can find all versions of the php package burntcaramel/perforated. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download burntcaramel/perforated
More information about burntcaramel/perforated
Files in burntcaramel/perforated
Package perforated
Short Description Simple yet pretty powerful forms using associated arrays or JSON, with automatic server validation, dependencies and more.
License MIT
Informations about the package perforated
Perforated – simple yet pretty powerful forms
Perforated forms are easy to create, read, and change later on. Define your form’s structure using a simple set up of key-based arrays, in PHP or JSON.
Edit easily.
The easy-to-understand syntax means you can quickly create a form in a few minutes. Use HTML5 entry types such as URL, email address, number, and checkbox. They are automatically validated on the server with no extra code.
Come back to it later and add, edit, remove. Adding new entries means just adding a few lines of simple code. The syntax is so simple you can even define your form in a JSON file, if you wish.
Style sensibly.
Perforated is designed to be smart. It groups related entries together in <fieldset>
elements.
Entries are automatically created with an associated <label>
.
This means it is very easy to style in CSS.
Target specific form entries.
Target all entries of a certain type.
Extend.
Perforated will automatically shows type-specific errors for incorrectly entered fields. Easily extend this validation. Add your own error messages.
Form processing and validation is completely separate from form display, so extend or replace how your form is validated or how it is displayed however you wish.
Automatically namespaced.
Submitted forms have their own namespace e.g. $_POST['formID']
This means it will not clash with other POST variables, so use fields like name
without worry in WordPress: http://stackoverflow.com/questions/15810948/post-returns-empty-on-form-submit-in-wordpress
Make sections dependant on whatever you wish.
Sections can be made to only show when a checkbox is on with one line. Just declare what you want, there's no extra JS.
External values can be used to automatically fill entries or for dependencies to turn sections on and off, just by using a simple callback. For example, only show and use a particular part of a form if the user is logged in – no complicated if-statements.
Example
Using external values from the server
Validating & processing
Working with submitted results
Displaying the form
TODO
- Client-side JavaScript validation, probably tie in with an existing project instead of writing from scratch.