PHPackages                             calderawp/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. calderawp/forms

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

calderawp/forms
===============

Forms

0.2.0(7y ago)08GPL-2.0PHPPHP ^7.2

Since Jan 9Pushed 7y ago2 watchersCompare

[ Source](https://github.com/CalderaWP/forms)[ Packagist](https://packagist.org/packages/calderawp/forms)[ RSS](/packages/calderawp-forms/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Forms
=====

[](#forms)

This is the forms package of the [Caldera Framework](https://github.com/CalderaWP/caldera) and provides form functionality, including entry tracking. **This is not Caldera Forms**.

👀🌋 This Is A Module Of The [Caldera Framework](https://github.com/CalderaWP/caldera)
------------------------------------------------------------------------------------

[](#-this-is-a-module-of-the-caldera-framework)

- 🌋 Find Caldera Forms Here:

    - [Caldera Forms on Github](http://github.com/calderawp/caldera-forms/)
    - [CalderaForms.com](http://calderaforms.com)
- 🌋 [Issues](https://github.com/CalderaWP/caldera/issues) and [pull requests](https://github.com/CalderaWP/caldera/pulls), should be submitted to the [main Caldera repo](https://github.com/CalderaWP/caldera/pulls).

### Install

[](#install)

- Add to your package:
    - `composer require calderawp/forms`
- Install for development:
    - `git clone git@github.com:CalderaWP/forms.git && composer install`

Examples
--------

[](#examples)

### Form Model

[](#form-model)

- Simple Example

```
$model = FormModel::fromArray([
    'id' => 'cf1',
    'name' => 'Contact Form',
    'fields' => [],
    'settings' => []
]);

```

- Example 2

```
//Create model
$form = \calderawp\caldera\Forms\FormModel::fromArray([
	'id' => 'cf1',
	'name' => 'Contact Form'
]);

//Email field
$emailField = \calderawp\caldera\Forms\FieldModel::fromArray([
	'id' => 'fld1',
	'type' => 'text',
	'slug' => 'email',
	'html5type' => 'email',
	'label' => 'Your Email'
]);

//Checkbox with two options
$checkBoxField = \calderawp\caldera\Forms\FieldModel::fromArray(
	[
		'id' => 'fld2',
		'type' => 'checkbox', //radio or select has same syntax for options
		'label' => 'I agree to privacy policy',
		'description' => 'Learn more by reading our privacy policy',
		'options' =>[
			[
				'label' => 'Yes',
				'value' => true
			],
			[
				'label' => 'No',
				'value' => false
			]
		]
	]
);

//Add fields to form
$form
	->addField($emailField)
	->addField($checkBoxField);

```

### Example With Many Fields

[](#example-with-many-fields)

```
$array = [
			'id' => 'cf1',
			'fields' => [
				'name' => [
					'id' => 'name',
					'type' => 'input',
					'label' => 'Your Name',
					'required' => true,
					'description' => 'Put your name here',
					'config' => [
						'html5type' => ''
					]
				],
				'numberOfItems' => [
					'id' => 'numberOfItems',
					'type' => 'input',
					'label' => 'Total',
					'description' => 'How many items?',
					'fieldConfig' => [
						'html5type' => 'number',
						'attributes' => [
							'min' => 0,
							'step' => 1
						]
					]
				],
				'agreeToTerms' => [
					'id' => 'agreeToTerms',
					'type' => 'select',
					'label' => 'Agree to terms',
					'description' => 'Compliance is mandatory',
					'fieldConfig' => [
						'multiple' => false,
						'options' => [
							[
								'value' => true,
								'label' => 'Yes'
							],
							[
								'value' => false,
								'label' => 'No'
							]
						]
					]
				]
			],
			'processors' => [
                [
                    'label' => 'Main Message',
                    'type' => 'testType',
                    'config' =>
                        [
                            'fromName' => 'fld1',
                            'fromEmail' => 'roy@hiroy.club',
                        ]
                ]
            ]
		];
		$model = FormModel::fromArray($array);
```

### Field Model

[](#field-model)

- Text field

```
$field = \calderawp\caldera\Forms\FieldModel::fromArray([
	'id' => 'fld1',
	'type' => 'input',
	'slug' => 'name',
	'label' => 'Your Name'
]);
```

- Email field

```
$field = \calderawp\caldera\Forms\FieldModel::fromArray([
	'id' => '',
	'type' => 'input',
    'html5type' => 'email',
	'slug' => '',
	'label' => '',
	'description' => ''
]);
```

- Number field

```
$field = \calderawp\caldera\Forms\FieldModel::fromArray([
	'id' => '',
	'type' => 'input',
    'html5type' => 'number',
	'slug' => '',
	'label' => '',
	'description' => '',
	'attributes' => [
        'min' => 5,
        'max' => 12
    ]
]);
```

Testing
-------

[](#testing)

- Run unit tests
    - `composer test:unit`
- Run integration tests
    - `composer test:integration`
- Run acceptance tests
    - `composer test:acceptance`

License, Copyright, etc.
------------------------

[](#license-copyright-etc)

Copyright 2018+ CalderaWP LLC and licensed under the terms of the GNU GPL license. Please share with your neighbor.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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 ~18 days

Total

3

Last Release

2649d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca938daf3f2a666cd32c7bdb6e30714da6fe0e6cd5012fe4864b18afae43fbcd?d=identicon)[Shelob9](/maintainers/Shelob9)

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/calderawp-forms/health.svg)

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

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k431.1M7.5k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

704122.9M10.1k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31278.1M2.0k](/packages/illuminate-container)[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)

PHPackages © 2026

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