PHPackages                             luyadev/luya-module-forms - 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. luyadev/luya-module-forms

ActiveLuya-module[Utility &amp; Helpers](/categories/utility)

luyadev/luya-module-forms
=========================

A form builder module for LUYA CMS.

1.8.1(2y ago)16.9k41MITPHP

Since Nov 25Pushed 2y ago3 watchersCompare

[ Source](https://github.com/luyadev/luya-module-forms)[ Packagist](https://packagist.org/packages/luyadev/luya-module-forms)[ RSS](/packages/luyadev-luya-module-forms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (23)Used By (1)

 [![LUYA Logo](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)

LUYA CMS Forms Builder
======================

[](#luya-cms-forms-builder)

[![LUYA](https://camo.githubusercontent.com/c30b61934591d3a6fcb8718a93fd61bf840c0abd8a8d49aa0fdd4ab99567bdf4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d4c5559412d627269676874677265656e2e737667)](https://luya.io)[![Tests](https://github.com/luyadev/luya-module-forms/workflows/Tests/badge.svg)](https://github.com/luyadev/luya-module-forms/workflows/Tests/badge.svg)[![Maintainability](https://camo.githubusercontent.com/03c7579918df1fd39c21417ea04a0943fb9306057dee6892b7b0e0048c409908/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34316635306562636437333330343036626363342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/luyadev/luya-module-forms/maintainability)[![Test Coverage](https://camo.githubusercontent.com/8f70d700cecb9e4b1acd74d3c1e56402bbff270e9c029d9e1259f30a702a55e6/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34316635306562636437333330343036626363342f746573745f636f766572616765)](https://codeclimate.com/github/luyadev/luya-module-forms/test_coverage)

A Drag &amp; Drop Forms Builder based on LUYA CMS Blocks.

Available forms module block extensions:

- [ReCaptcha 3 Forms Block](https://github.com/luyadev/luya-forms-captcha)

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

[](#installation)

Install the extension through composer:

```
composer require luyadev/luya-module-forms
```

Add the module to the config

```
'modules' => [
    //...
    'forms' => [
        'class' => 'luya\forms\Module',
    ]
]
```

Run the migrate command which does the database table setup:

```
./luya migrate
```

Run the import command in order to setup all the need permissions:

```
./luya import
```

Adjust Mailer Component
-----------------------

[](#adjust-mailer-component)

In order to customize the mailer component which should be taken for sending the mails, define the Forms component with the given callback.

```
'components' => [
    //...
    'forms' => [
        'class' => 'luya\forms\Forms',
        'emailMessage' => function (SubmissionEmail $email, Forms $form) {

            // your custom mailer integration is here, ensure to return a boolean
            // value whether sending was successfull or not!
            return \Yii::$app->mailer->compose()
                ->setFrom(...)
                ->setTo($email->getRecipients())
                ->setSubject($email->getSubject())
                ->setTextBody($email->getBodyText())
                ->setHtmlBody($email->getBodyHtml())
                ->send();
        }
    ]
]
```

Maybe the client would like to recieve a custom email, therefore you can extract the attribute value with `$email->submission->getValueByAttribute('email_attribute_in_form')`.

```
'emailMessage' => function (SubmissionEmail $email, Forms $form) {
    return Yii::$app->mailer->compose()
        ->setTo($email->submission->getValueByAttribute('email')) // receives the value from the user entered data.
        ....
}
```

Create Custom Form Field Blocks
-------------------------------

[](#create-custom-form-field-blocks)

The default blocks may not suit your needs, therefore its possible to create your own from input block:

```
class MyDropDownBlock extends PhpBlock
{
    use FieldBlockTrait;

    public function name()
    {
        return 'Dropdown';
    }

    public function admin()
    {
        return 'My Dropdown {{vars.label}}';
    }

    public function frontend()
    {
        Yii::$app->forms->autoConfigureAttribute(
            $this->getVarValue($this->varAttribute),
            $this->getVarValue($this->varRule, $this->defaultRule),
            $this->getVarValue($this->varIsRequired),
            $this->getVarValue($this->varLabel),
            $this->getVarValue($this->varHint)
        );

        // Use all possible options with ActiveField or use the HtmlHelper
        return Yii::$app->forms->form->field(Yii::$app->forms->model, $this->getVarValue($this->varAttribute))
            ->dropDownList([1 => 'Foo', 2 => 'Bar']);
    }
}
```

Development
-----------

[](#development)

Refresh message files:

```
./vendor/bin/luya message msgconfig.php
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 92.6% 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 ~53 days

Recently: every ~21 days

Total

21

Last Release

931d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86184bf08843ed8fcc4aedb2fdecd8a9e832e47e89a7166cebfda529c176f5ce?d=identicon)[nadar](/maintainers/nadar)

---

Top Contributors

[![nadar](https://avatars.githubusercontent.com/u/3417221?v=4)](https://github.com/nadar "nadar (188 commits)")[![rolandschaub](https://avatars.githubusercontent.com/u/3786245?v=4)](https://github.com/rolandschaub "rolandschaub (8 commits)")[![hbugdoll](https://avatars.githubusercontent.com/u/6715827?v=4)](https://github.com/hbugdoll "hbugdoll (4 commits)")[![AndreGM](https://avatars.githubusercontent.com/u/1381773?v=4)](https://github.com/AndreGM "AndreGM (2 commits)")[![dennisgon](https://avatars.githubusercontent.com/u/6257311?v=4)](https://github.com/dennisgon "dennisgon (1 commits)")

---

Tags

formformbuilderformshacktoberfestluyaluya

### Embed Badge

![Health badge](/badges/luyadev-luya-module-forms/health.svg)

```
[![Health](https://phpackages.com/badges/luyadev-luya-module-forms/health.svg)](https://phpackages.com/packages/luyadev-luya-module-forms)
```

###  Alternatives

[cebe/luya-module-sitemap

sitemap.xml module for luya CMS

115.9k](/packages/cebe-luya-module-sitemap)

PHPackages © 2026

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