PHPackages                             offline/oc-forms-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. offline/oc-forms-plugin

ActiveOctober-plugin[Utility &amp; Helpers](/categories/utility)

offline/oc-forms-plugin
=======================

Simple Form Builder Plugin for October CMS

v1.0.51(5mo ago)1403↓50%2MITPHPPHP &gt;=8.1

Since May 15Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/OFFLINE-GmbH/oc-forms-plugin)[ Packagist](https://packagist.org/packages/offline/oc-forms-plugin)[ RSS](/packages/offline-oc-forms-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (51)Used By (0)

Forms plugin for October CMS
============================

[](#forms-plugin-for-october-cms)

This plugin provides a simple way to create frontend forms.

Installation
------------

[](#installation)

Install the plugin using composer:

```
composer require offline/oc-forms-plugin

```

Features
--------

[](#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](https://octobercms.com/plugin/responsiv-uploader)
- Integrates with [OFFLINE.Boxes](https://octobercms.com/plugin/offline-boxes) out-of-the-box.

Usage
-----

[](#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
----------

[](#components)

### `renderForm`

[](#renderform)

Use the `renderForm` component to display a form on the frontend.

#### AJAX framework dependency

[](#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

[](#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

[](#form-classes)

Use the `formClasses` property to add additional CSS classes to the form element.

#### Honeypot

[](#honeypot)

The form comes with a honeypot field to prevent spam. You can disable this by setting the `honeypot` property to `false`.

#### File uploads

[](#file-uploads)

To enable file uploads, you need to install the [Responsiv.Uploader](https://octobercms.com/plugin/responsiv-uploader) plugin:

```
composer require 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.

#### Captcha Support

[](#captcha-support)

To enable captcha support, you need to install the [Captcha for Laravel](https://github.com/mewebstudio/captcha) composer package:

```
composer require mews/captcha
```

Once the package is installed, you can enable the captcha field in the form settings.

#### Field overrides

[](#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

[](#name-overrides)

Override a field by its name. To do so, create a partial with the following name:

```
_name_{fieldName}.htm
# Example: _name_address.htm
# Important: The field name is sluggified. So "Your Name" becomes "your-name".
```

##### Type overrides

[](#type-overrides)

Override all fields with a given input type. To do so, create a partial with the following name:

```
_type_{fieldType}.htm
# Example: _type_email.htm
```

##### Generic overrides

[](#generic-overrides)

Take a look at the [default partials](./components/renderform) of the `renderForm` component. You can override any other partial like the `label` or the `validation` message.

OFFLINE.Boxes integration
-------------------------

[](#offlineboxes-integration)

To make the `renderForm` component available in Boxes, use the following partial:

### form.htm

[](#formhtm)

```
{% component box.uniqueComponentAlias('renderForm') %}
```

### form.yaml

[](#formyaml)

```
handle: OFFLINE.Forms::forms
name: 'offline.forms::lang.forms'
section: 'offline.forms::lang.boxes_section'

validation:
    rules:
        form: required

components:
    renderForm:
        uniqueAlias: true
        # properties:
        #   formClasses: 'floating-label'
        #   cssPrefix: 'prefix-'
        #   includeJQuery: true
        #   includeFramework: true

form:
    fields:
        form:
            label: 'offline.forms::lang.form'
            type: dropdown
            span: full
            emptyOption: 'offline.forms::lang.form_empty_option'
            options: '\OFFLINE\Forms\Models\Form::getFormOptions'
```

Helper methods
--------------

[](#helper-methods)

### `prependField` and `appendField`

[](#prependfield-and-appendfield)

These two methods allow you to add fields to the form before or after the existing fields.

```
$form->prependField([
    'name' => 'some-field',
    'label' => 'First field',
    'type' => 'text',
]);
```

### `mapFields`

[](#mapfields)

Apply a transform to each field in the form. The transform will receive the field as its first argument.

```
$form->mapFields(function (array $field) {
    if (array_get($field, 'is_required')) {
        $field['label'] .= ' (required)';
    }

    return $field;
});
```

### `applyPlaceholderToFields`

[](#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.

```
$form->applyPlaceholderToFields(function(array $field) {
    if (array_get($field, 'is_required')) {
        $field['placeholder'] .= ' *';
    }

    return $field;
});
```

Events
------

[](#events)

### `offline.forms::form.extend`

[](#offlineformsformextend)

Use this event to apply changes to the form globally (frontend, backend, export).

```
Event::listen(
    \OFFLINE\Forms\Classes\Events::FORM_EXTEND,
    function (\OFFLINE\Forms\Models\Form $form, string $context, $widget) {
            if ($context === Contexts::FIELDS) {
                // Form fields are being extended.
                info('$widget is a Backend Form widget');
            } else if ($context === Contexts::COLUMNS) {
                // List columns are being extended.
                info('$widget is a Backend Lists widget');
            } else if ($context === Contexts::COMPONENT) {
                // The form is rendered in the component.
                info('$widget is the RenderForm component');
            } else if ($context === Contexts::MAIL) {
                // The mail for a form submission is being sent.
                info('$widget is null');
            }

            // Add a field for a specific form.
            if ($form->slug === 'my-form') {
                $form->prependField([
                    'name' => 'my-hidden-value',
                    'label' => 'Something additional',
                    'type' => 'hidden',
                    'value' => 'Top secret'
                ]);
            }
    }
);
```

### `offline.forms::form.beforeRender`

[](#offlineformsformbeforerender)

Use this event to change the form before it is rendered.

```
Event::listen(
    \OFFLINE\Forms\Classes\Events::FORM_BEFORE_RENDER,
    function (\OFFLINE\Forms\Models\Form $form, \OFFLINE\Forms\Components\RenderForm $component) {
        // Do anything with the form or $form->fields here.
        $form->applyPlaceholderToFields();
    }
);
```

### `offline.forms::submission.overrideMailView`

[](#offlineformssubmissionoverridemailview)

Use this event to change the mail view for a submission mail,

```
Event::listen(
    \OFFLINE\Forms\Classes\Events::SUBMISSION_OVERRIDE_MAIL_VIEW,
    function (\OFFLINE\Forms\Models\Submission $submission) {
    if ($submission->form->slug === 'something-special') {
        return 'my-custom-mail-view';
    }
);
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance71

Regular maintenance activity

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~51 days

Total

49

Last Release

164d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8600029?v=4)[Tobias Kündig](/maintainers/tobias-kuendig)[@tobias-kuendig](https://github.com/tobias-kuendig)

---

Top Contributors

[![tobias-kuendig](https://avatars.githubusercontent.com/u/8600029?v=4)](https://github.com/tobias-kuendig "tobias-kuendig (84 commits)")[![verenaroe](https://avatars.githubusercontent.com/u/49275087?v=4)](https://github.com/verenaroe "verenaroe (7 commits)")

### Embed Badge

![Health badge](/badges/offline-oc-forms-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/offline-oc-forms-plugin/health.svg)](https://phpackages.com/packages/offline-oc-forms-plugin)
```

###  Alternatives

[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[lovata/oc-toolbox-plugin

Toolbox plugin for October CMS

3812.0k](/packages/lovata-oc-toolbox-plugin)[magyarjeti/laravel-lipsum

Lorem ipsum generator for Laravel Framework

1617.9k](/packages/magyarjeti-laravel-lipsum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
