Skip to content

netcarver/fxForm

Repository files navigation

An experimental HTML Form class and supporting elements.

Built using some components and ideas from Will Bond’s Flourish library and with a little inspiration from ProcessWire by Ryan Cramer.

Installation

  • Setup a PW testbed
  • Download and install flourish into siteroot/.flourish
  • Follow these instructions to get flourish’s classes autoloading
  • Create a directory at siteroot/forms and copy all the files here except contact.php into it.
  • Copy contact.php into siteroot/templates
  • Login to ProcessWire and go to Setup > Templates and hit the ‘Add New Template’ button. Select contact.php and create a template called ‘contact’, add a title field (if not present) and save the template.
  • Go to Pages and add a new page called ‘contact’ that uses the template called ‘contact’.
  • You should now be able to visit siteroot/contact in your browser and see the example contact form laid out for you.

Extension

It should now be fairly trivial to add additional fields to your template for destination email address, SMTP server and password etc such that the form’s onSuccess method could use that information to send the contact details out for real.

The supplied contact.php file is a simple demonstration of some of the features of this library and of how to use a fluent interface to define a public facing HTML form. Feel free to tinker within that file, you should find it fairly well documented, or to start developing your own forms.

Feedback

Any feedback on #processwire on irc.freenode.net, by posting or PM in the ProcessWire forums please.

License

GPLv2

Thank you for taking an interest, and enjoy!

Steve

About

DSL for building web-forms in PHP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages