PHPackages                             cakephp/form - 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. [Framework](/categories/framework)
4. /
5. cakephp/form

ActiveLibrary[Framework](/categories/framework)

cakephp/form
============

CakePHP Form library

5.3.2(4mo ago)81.8k1MITPHPPHP &gt;=8.2

Since Dec 19Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/cakephp/form)[ Packagist](https://packagist.org/packages/cakephp/form)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-form/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (269)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/d92c9626d690584eaf39ee1715a67fb7740dca1bdb0c07695ce7bcb2ccc1f59e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f666f726d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/form)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

CakePHP Form Library
====================

[](#cakephp-form-library)

Form abstraction used to create forms not tied to ORM backed models, or to other permanent datastores. Ideal for implementing forms on top of API services, or contact forms.

Usage
-----

[](#usage)

```
use Cake\Form\Form;
use Cake\Form\Schema;
use Cake\Validation\Validator;

class ContactForm extends Form
{

    protected function _buildSchema(Schema $schema)
    {
        return $schema->addField('name', 'string')
            ->addField('email', ['type' => 'string'])
            ->addField('body', ['type' => 'text']);
    }

    public function validationDefault(Validator $validator)
    {
        return $validator->add('name', 'length', [
                'rule' => ['minLength', 10],
                'message' => 'A name is required'
            ])->add('email', 'format', [
                'rule' => 'email',
                'message' => 'A valid email address is required',
            ]);
    }

    protected function _execute(array $data)
    {
        // Send an email.
        return true;
    }
}
```

In the above example we see the 3 hook methods that forms provide:

- `_buildSchema()` is used to define the schema data. You can define field type, length, and precision.
- `validationDefault()` Gets a `Cake\Validation\Validator` instance that you can attach validators to.
- `_execute()` lets you define the behavior you want to happen when `execute()` is called and the data is valid.

You can always define additional public methods as you need as well.

```
$contact = new ContactForm();
$success = $contact->execute($data);
$errors = $contact->getErrors();
```

Documentation
-------------

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/4/en/core-libraries/form.html)

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~35 days

Total

265

Last Release

65d ago

Major Versions

3.10.0 → 4.2.02020-12-04

4.4.9 → 5.0.0-beta12022-06-29

4.5.0-RC1 → 5.0.0-RC22023-04-01

4.5.3 → 5.0.02023-09-08

5.x-dev → 6.x-dev2026-03-15

PHP version history (7 changes)3.5.0PHP &gt;=5.6.0

4.0.0-beta1PHP &gt;=7.2.0

3.10.1PHP &gt;=5.6.0,&lt;8.0.0

4.4.0-RC2PHP &gt;=7.4.0

5.0.0-beta1PHP &gt;=8.1

5.3.0-RC2PHP &gt;=8.2

6.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (59 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (38 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (10 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (8 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (5 commits)")[![ceeram](https://avatars.githubusercontent.com/u/111448?v=4)](https://github.com/ceeram "ceeram (3 commits)")[![diegosardina](https://avatars.githubusercontent.com/u/22911186?v=4)](https://github.com/diegosardina "diegosardina (2 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (2 commits)")[![burzum](https://avatars.githubusercontent.com/u/162789?v=4)](https://github.com/burzum "burzum (2 commits)")[![josegonzalez](https://avatars.githubusercontent.com/u/65675?v=4)](https://github.com/josegonzalez "josegonzalez (2 commits)")[![stickler-ci](https://avatars.githubusercontent.com/u/16011037?v=4)](https://github.com/stickler-ci "stickler-ci (2 commits)")[![saeideng](https://avatars.githubusercontent.com/u/8215801?v=4)](https://github.com/saeideng "saeideng (2 commits)")[![andrii-pukhalevych](https://avatars.githubusercontent.com/u/3767063?v=4)](https://github.com/andrii-pukhalevych "andrii-pukhalevych (2 commits)")[![tenkoma](https://avatars.githubusercontent.com/u/16202?v=4)](https://github.com/tenkoma "tenkoma (1 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (1 commits)")[![highstrike](https://avatars.githubusercontent.com/u/2379538?v=4)](https://github.com/highstrike "highstrike (1 commits)")[![inoas](https://avatars.githubusercontent.com/u/20972207?v=4)](https://github.com/inoas "inoas (1 commits)")[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (1 commits)")

---

Tags

cakephpform

### Embed Badge

![Health badge](/badges/cakephp-form/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[cakephp/orm

CakePHP ORM - Provides a flexible and powerful ORM implementing a data-mapper pattern.

151242.6k70](/packages/cakephp-orm)[cakephp/debug_kit

CakePHP Debug Kit

86514.0M138](/packages/cakephp-debug-kit)[cakephp/cache

Easy to use Caching library with support for multiple caching backends

498.5M16](/packages/cakephp-cache)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12127.1M63](/packages/cakephp-utility)

PHPackages © 2026

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