Pieforms 0.2.2
Sponsored Links
Pieforms 0.2.2 Ranking & Summary
File size:
MB
Platform:
Any Platform
License:
GPL (GNU General Public License)
Price:
Downloads:
930
Date added:
2007-04-09
Publisher:
Nigel McNie
Pieforms 0.2.2 description
Pieforms project provides a simple, unified way to create, validate and process forms all with a common look and feel, with support for pluggable elements, renderers and validation rules.
Huh? What does all that mean?
In simple terms, Pieforms provides a library for building HTML forms. So rather than writing all that HTML yourself for building forms, handling the validation and processing of them in whatever messy, inconsistent way youre doing it currently, you simply define a big hash in your script that describes your form. Pieforms does all of the legwork involved with building the form HTML from this hash (using elements and renderers), and also handles the validation of input using rules. In the general case, after youve defined you form, all you need to do is write a callback function that gets called when the form has been submitted with the data valid according to the rules.
Sounds interesting! Show me an example...
Okay, so youre writing a simple form that has a standard < input type="text" > and a textarea on it, with a submit button. Youd write a script similar to the following:
require_once(pieform.php);
$form = array(
name => myform,
method => get,
elements => array(
text => array(
type => text,
title => Text Element,
description => A little text box for you
rules => array(
required => true
)
),
textarea => array(
type => textarea,
title => Textarea,
defaultvalue => Some default text for the textarea,
rows => 7,
cols => 50
),
submit => array(
type => submit,
value => Submit form!
)
)
);
echo pieform($form);
function myform_submit($values) {
echo "Your submitted values:< br >";
foreach ($values as $key => $value) {
echo "$key: $value< br> ";
}
}
You see how easy that is? You didnt have to write any HTML - in fact, the entire definition is in PHP, which means if you make mistakes theyll show up as parse errors, rather than HTML validity errors (which are generally less often checked for). You only called one function to have everything done for you. And you can write a function to handle submission, full well knowing that the text element will always have a value that isnt the empty string.
After that, the submnit function is almost academic. You just save whatever you want to the database or whatever, and then the last thing you should do is redirect the user somewhere, perhaps to the same page or perhaps elsewhere.
For AJAX forms, all you have to do is add ajaxpost => true in the $form array, and then make your submit function output JSON in the form {error: [false or true], message: some message}, and then exit. Pieforms includes an implementation of json_encode for your convenience.
Okay, that looks easy! What else can it do?
The best part is that the elements, renderers and rules for your forms are pluggable. For example, you could write a wysiwyg element which behaves like the textarea one, but also includes javascript necessary to turn the textarea into a full WYSIWYG editor. Or you could write an element with two select boxes, arrows to move items left and right, and AJAX searching of the boxes. The possibilities are limitless! You can also write your own rules for reuse later (and change how elements respond to those rules if necessary), and write your own renderers (which handle the HTML surrounding the elements), so you can do things like add a little help icon next to each element with a link to a page explaining how the element works.
Huh? What does all that mean?
In simple terms, Pieforms provides a library for building HTML forms. So rather than writing all that HTML yourself for building forms, handling the validation and processing of them in whatever messy, inconsistent way youre doing it currently, you simply define a big hash in your script that describes your form. Pieforms does all of the legwork involved with building the form HTML from this hash (using elements and renderers), and also handles the validation of input using rules. In the general case, after youve defined you form, all you need to do is write a callback function that gets called when the form has been submitted with the data valid according to the rules.
Sounds interesting! Show me an example...
Okay, so youre writing a simple form that has a standard < input type="text" > and a textarea on it, with a submit button. Youd write a script similar to the following:
require_once(pieform.php);
$form = array(
name => myform,
method => get,
elements => array(
text => array(
type => text,
title => Text Element,
description => A little text box for you
rules => array(
required => true
)
),
textarea => array(
type => textarea,
title => Textarea,
defaultvalue => Some default text for the textarea,
rows => 7,
cols => 50
),
submit => array(
type => submit,
value => Submit form!
)
)
);
echo pieform($form);
function myform_submit($values) {
echo "Your submitted values:< br >";
foreach ($values as $key => $value) {
echo "$key: $value< br> ";
}
}
You see how easy that is? You didnt have to write any HTML - in fact, the entire definition is in PHP, which means if you make mistakes theyll show up as parse errors, rather than HTML validity errors (which are generally less often checked for). You only called one function to have everything done for you. And you can write a function to handle submission, full well knowing that the text element will always have a value that isnt the empty string.
After that, the submnit function is almost academic. You just save whatever you want to the database or whatever, and then the last thing you should do is redirect the user somewhere, perhaps to the same page or perhaps elsewhere.
For AJAX forms, all you have to do is add ajaxpost => true in the $form array, and then make your submit function output JSON in the form {error: [false or true], message: some message}, and then exit. Pieforms includes an implementation of json_encode for your convenience.
Okay, that looks easy! What else can it do?
The best part is that the elements, renderers and rules for your forms are pluggable. For example, you could write a wysiwyg element which behaves like the textarea one, but also includes javascript necessary to turn the textarea into a full WYSIWYG editor. Or you could write an element with two select boxes, arrows to move items left and right, and AJAX searching of the boxes. The possibilities are limitless! You can also write your own rules for reuse later (and change how elements respond to those rules if necessary), and write your own renderers (which handle the HTML surrounding the elements), so you can do things like add a little help icon next to each element with a link to a page explaining how the element works.
Pieforms 0.2.2 Screenshot
Pieforms 0.2.2 Keywords
HTML
Pieforms 0.2.2
Way To
To Create
process forms
Pieforms
form
forms
write
text
rules
Pieforms 0.2.2
HTTP
Internet
Bookmark Pieforms 0.2.2
Pieforms 0.2.2 Copyright
WareSeeker periodically updates pricing and software information of Pieforms 0.2.2 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Pieforms 0.2.2 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
irs forms
tax forms
legal forms
federal tax forms
irs tax forms
how do hurricanes form
write resume
forms of autism
wal mart employment application form
mma cage writer undefined
formsrus
writers guild of america
aha acls course roster form
forms of energy
writers almanac
irs form w9
writers guild strike
how to write a resume
Version History
Related Software
This provides a Python API to common Javascript features for forms written with the 'z3c.form' packages. Free Download
phpForm provides a PHP3 application that allows you to easily create Web forms. Free Download
CURSEL project is a freeware FMLI implementation. Free Download
Plone Tabs provides a user-friendly product for managing the tabs on the Plone site. Free Download
libdaisy is an engine for parsing Digital Talking Books (DTB) according to the Daisy ANSI/NISO standard. Free Download
jnget is a command-line tool for retrieving binaries from Usenet. Free Download
gdiff-ext is a file manager context menu extension to launch comparison tools. Free Download
Firedrop2 is a client-side blog tool that makes it possible to create and maintain your blogs on your PC. Free Download
Latest Software
Popular Software
Favourite Software