Skip to content

A plugin to easily create tableless forms with validation, db storage and email forwarding.

Notifications You must be signed in to change notification settings

sambernard/cakeforms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cakeforms 0.1
***********************************
An easy to use form plugin inspired by the amazing Cforms plugin for Wordpress(http://www.deliciousdays.com/cforms-plugin/)

Installation
============

Instructions for Use
============
**Creating Forms:
1)  Go to /admin/cforms/add
2)  Name your form
3)  Add fields. Field Name _should_ be unique- it probably won't mess anything up but only the last field with a name will be processed
    *The label can be left blank.
    *Field types are standard- as of right now if 'checkbox' is selected the required option will _not_ work- it won't cause any errors it just doesn't work right now.
    *If a field can have options(e.g. checkbox, select), you enter options as a comma separated list
    *Adding validation- the standatd rules are included- if you want to edit the message displayed go to /admin/cforms/validation_rules/

**Displaying Forms:
Forms can either be displayed by editing your action/template or they can be displayed inline(such as in the middle of page content).
Inline forms add to the overhead of the pageload(because of the extra work that goes into rendering the form);

-=Inline Forms=-
1)  Add 'Cforms.Cakeform' to your list of components
2)  The Component must be configured in the $components array-
3)  Add {cform_ID} to the content of your page(or wherever)

-=Other Forms=-
1)  Add 'Cforms.Cakeform' to your list of components
2)  Call '$this->set('formData', $this->Cakeform->loadForm($formId))' in your controller- $formId is the id of your form
3)  Call '$cform->insert($formData)' in your view
4)  The component will take care of catching the form data- by default the form action is set to the current route. The default config will send the contents of the form to the email specified in the form config, and store the results in the database, which can be viewed at /admin/cforms/submissions/

**Processing form data
*(optional) create the function beforeCformsSave(&$data) in your controller/AppController- it is only called after the data has been validated but before
it is saved to the db. This allows you to do any data massaging logic you may need(such as getting rid of things you don't want saved in the db or credit card processing).
This function must return true or the data will not be saved in the DB.
*(optional) create the function afterCformsSave($data) in your controller/AppController- it is only called after the data has been validated and
saved to the database

**Form Config Options:
*Alternative Form Action: Modifies the action of the form... you lose any validation/processing of the data _unless_ the cform
component is included in the controller that the action points to.
*Redirect: Sets a redirect after the form has been processed
*Admin email: The email address to which form submissions are sent
*From emai: The email address from which submissions are sent




Features
============
* Allow simple form creation via jQuery UI
* Field Validation
* Per Form Recipients
* Database Tracking
* CSV Export
* Embed form anywhere using component and helper
* Autoresponder

Coming Soon
=============
* Multi-page forms

About

A plugin to easily create tableless forms with validation, db storage and email forwarding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages