Download the PHP package offline/oc-forms-plugin without Composer
On this page you can find all versions of the php package offline/oc-forms-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download offline/oc-forms-plugin
More information about offline/oc-forms-plugin
Files in offline/oc-forms-plugin
Package oc-forms-plugin
Short Description Simple Form Builder Plugin for October CMS
License MIT
Informations about the package oc-forms-plugin
Forms plugin for October CMS
This plugin provides a simple way to create frontend forms.
Installation
Install the plugin using composer:
Features
- Create forms in the backend
- Display forms on the frontend
- View submissions in the backend
- Send email notifications on form submission
- Export submissions to CSV
- Multisite support
- Optional file uploads using Responsiv.Uploader
- Integrates with OFFLINE.Boxes out-of-the-box.
Usage
In the backend, go to the Forms menu item and create a new form. You can use the renderForm
component to display
the form on the frontend. All submissions of the form will be visible in the backend.
Components
renderForm
Use the renderForm
component to display a form on the frontend.
AJAX framework dependency
The component requires the AJAX framework to be present on the page.
You can set the includeFramework
property to true
to include the framework automatically.
CSS classes
The default form markup comes with a few CSS classes that you can use to style your form.
You can set the cssPrefix
property to change the prefix of the CSS classes.
Form classes
Use the formClasses
property to add additional CSS classes to the form element.
Honeypot
The form comes with a honeypot field to prevent spam. You can disable this by setting the honeypot
property to false
.
File uploads
To enable file uploads, you need to install the Responsiv.Uploader plugin:
After installing the plugin, you can add file upload fields to your form in the backend.
You can use the fileuploadPlaceholderText
property to define a custom placeholder text for the upload button.
Important: Responsiv.Uploader depends on jQuery. This means you need to include jQuery on your page.
Set the includeJQuery
property to true
if you want the component to include jQuery automatically.
Captach Support
To enable captcha support, you need to install the Captacha for Laravel composer package:
Once the package is installed, you can enable the captcha field in the form settings.
Field overrides
The renderForm
component comes with a powerful way to override the default form field partials.
To do so, create a partial with the proper name in your partials
directory.
Overrides are process in the following order:
Name overrides
Override a field by its name. To do so, create a partial with the following name:
Type overrides
Override all fields with a given input type. To do so, create a partial with the following name:
Generic overrides
Take a look at the default partials of the renderForm
component.
You can override any other partial like the label
or the validation
message.
OFFLINE.Boxes integration
To make the renderForm
component available in Boxes, use the following partial:
form.htm
form.yaml
Helper methods
prependField
and appendField
These two methods allow you to add fields to the form before or after the existing fields.
mapFields
Apply a transform to each field in the form. The transform will receive the field as its first argument.
applyPlaceholderToFields
The Form
model provides a simple helper method to apply placeholders to all fields
that have no placeholder set. The label
property of the field will be used as the placeholder.
This is useful for "floating label" form implementations where each field must have a placeholder.
You can pass in an optional transform function.
Events
offline.forms::form.extend
Use this event to apply changes to the form globally (frontend, backend, export).
offline.forms::form.beforeRender
Use this event to change the form before it is rendered.