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

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

venne/forms
===========

Venne forms component

01311PHP

Since Mar 3Pushed 11y ago2 watchersCompare

[ Source](https://github.com/Venne/forms)[ Packagist](https://packagist.org/packages/venne/forms)[ RSS](/packages/venne-forms/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Venne:Forms [![Build Status](https://camo.githubusercontent.com/cea4770bb99ce0dd7de04bb146c5c222dec7012f32e392b12b0c5056b14ba2f1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f56656e6e652f666f726d732e706e67)](http://travis-ci.org/Venne/forms)
=============================================================================================================================================================================================================================================================

[](#venneforms-)

Create forms as nested factories:

```
+- IFormFactory ---+    +- IFormFactory --+    +- IFormFactory -+
|   Base factory   | -> |   Adds inputs   | -> |  Adds mapping  | -> create() : Form
+------------------+    +-----------------+    +----------------+

```

**Benefits:**

- Change form configuration around the application on one place.
- Each factory can be used independently.
- It is not necessary to inherit forms.

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

[](#installation)

The best way to install Venne/Forms is using Composer:

```
composer require venne/forms:@dev
```

Usage
-----

[](#usage)

### Create basic factory

[](#create-basic-factory)

example:

```
services:
	basicFormFactory:
		class: Nette\Application\UI\Form
		arguments: [NULL, NULL]
		implement: Venne\Forms\IFormFactory
		setup:
			- setRenderer(@system.formRenderer)
			- setTranslator(@translator.translator)
		autowired: no
```

### Create forms as factory

[](#create-forms-as-factory)

Implement `Venne\Forms\IFormFactory`:

```
class FooFormFactory implements Venne\Forms\IFormFactory
{

	private $formFactory;

	public function __construct(IFormFactory $formFactory)
	{
		$this->formFactory = $formFactory;
	}

	public function create()
	{
		$form = $this->formFactory->create();
		$form->addText('foo', 'Foo');
		$form->addSubmit('_submit', 'Save');
		return $form;
	}

}
```

### Register forms

[](#register-forms)

Define nested formFactory in constructor

```
services:
	fooFormFactory:
		class: FooFormFactory(@basicFormFactory)
```

### Use it in presenter

[](#use-it-in-presenter)

```
class ExamplePresenter extends Nette\Application\UI\Presenter
{

	private $fooFormFactory;

	public function __construct(FooFormFactory $fooFormFactory)
	{
		$this->fooFormFactory = $fooFormFactory;
	}

	public function createComponentFooForm()
	{
		$form = $this->fooFormFactory->create();
		$form->onSuccess[] = $this->fooFormSuccess;
		return $form;
	}

	public function fooFormSuccess($form)
	{
		...
	}

}
```

Connect forms with `kdyby\doctrine-forms`
-----------------------------------------

[](#connect-forms-with-kdybydoctrine-forms)

```
use Venne\Bridges\Kdyby\DoctrineForms\FormFactoryFactory;

class ExamplePresenter extends Nette\Application\UI\Presenter
{

	private $fooFormFactory;
	private $formFactoryFactory;

	public function __construct(FooFormFactory $fooFormFactory, FormFactoryFactory $formFactoryFactory)
	{
		$this->fooFormFactory = $fooFormFactory;
		$this->formFactoryFactory = $formFactoryFactory;
	}

	public function createComponentFooForm()
	{
		$entity = ....;

		$form = $this->formFactoryFactory
					->create($this->fooFormFactory)
					->setEntity($entity)
					->create();

		$form->onSuccess[] = $this->fooFormSuccess;
		return $form;
	}

	public function fooFormSuccess($form)
	{
		...
	}

}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![pepakriz](https://avatars.githubusercontent.com/u/383294?v=4)](https://github.com/pepakriz "pepakriz (14 commits)")

### Embed Badge

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

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

###  Alternatives

[touhonoob/rate-limit

PHP rate limiting library with Token Bucket Algorithm

137520.0k2](/packages/touhonoob-rate-limit)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40180.2k2](/packages/ballen-distical)

PHPackages © 2026

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