PHPackages                             drarok/konform - 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. [Templating &amp; Views](/categories/templating)
4. /
5. drarok/konform

ActiveKohana-module[Templating &amp; Views](/categories/templating)

drarok/konform
==============

Simple form generator for Kohana, using PHPTAL templates.

07PHP

Since Nov 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Drarok/Konform)[ Packagist](https://packagist.org/packages/drarok/konform)[ RSS](/packages/drarok-konform/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Konform - Simple form generator for Kohana 3.3+
===============================================

[](#konform---simple-form-generator-for-kohana-33)

Requirements
------------

[](#requirements)

You'll need the [KOtal](https://github.com/Drarok/KOtal) module, as the views are written in PHPTAL.

Usage
-----

[](#usage)

- Create a subclass of Konform (Konform\_Contact, for example).
- Set the $\_fields property up in your subclass (either in its \_init() method, or just at the top of the class).
- Create a messages/konform/contact.php file, and populate it with your error messages.
- Instantiate your class and use it (see below).
- Add some CSS to target these forms, and enjoy.

Examples
--------

[](#examples)

Here's a contact form, demonstrating each form element.

```
class Konform_Contact extends Konform
{
	/**
	 * Action (location) to submit the form to.
	 *
	 * @var string
	 */
	protected $_action = '/contact';

	/**
	 * Other attributes (name => value) to apply to the form.
	 *
	 * @var array
	 */
	protected $_attributes = array(
		'id'    => 'something'
		'class' => 'konform contact',
	);

	/**
	 * Fields, keyed on their name, with label, rules, type, and other options.
	 *
	 * @var array
	 */
	protected $_fields = array(
		// Simple text entry box.
		'name' => array(
			'type'      => 'text',
			'label'     => 'Your name',
			'maxlength' => 60,
			'required'  => true,
			'rules'     => array('not_empty'),
		),

		// One with more validation on it, and a custom CSS class applied to the container.
		'email' => array(
			'type'     => 'text',
			'label'    => 'Your email address',
			'required' => true,
			'rules'    => array('not_empty', 'email'),
			'class'    => 'email',
		),

		// Example of a select element.
		'group' => array(
			'type'         => 'select',
			'label'        => 'Person or group',
			'required'     => true,
			'rules'        => array('not_empty'),
			'placeholder'  => 'Please select...',
			'optionSource' => '_getGroups',
			'optionValue'  => 'pk',
			'optionLabel'  => 'name',
		),

		// And a textarea.
		'body' => array(
			'type'     => 'textarea',
			'label'    => 'Your message',
			'required' => true,
			'rules'    => array('not_empty'),
			'cols'     => '70',
			'rows'     => '10',
		),

		// Don't forget to add a submit button.
		'submit' => array(
			'type' => 'submit',
			'label' => 'Submit',
			'class' => 'buttons'
		),
	);

	/**
	 * Get the groups for the dropdown list.
	 *
	 * These source methods must return something iterable (suitable for reading
	 * by foreach - arrays, Iterators, etc).
	 *
	 * @return Database_Result
	 */
	protected function _getGroups()
	{
		return ORM::factory('group')->find_all();
	}
}

```

And, here's the controller code to go with it.

```
public function action_index()
{
	$contactForm = new Konform_Contact($this->request->post());
	if ($this->request->post() && $contactForm->validate()) {
		// Looks like we received valid data, so send the emails.
		$this->_sendContactEmail($contactForm->data());
		HTTP::redirect('/contact/thank-you');
	}

	$this->response->body($contactForm->render());
}

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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/c2fecfeadca598be917b367e724355b2ca1bef3611ca1bc4ad65435674a7e9d4?d=identicon)[Drarok](/maintainers/Drarok)

---

Top Contributors

[![Drarok](https://avatars.githubusercontent.com/u/55830?v=4)](https://github.com/Drarok "Drarok (9 commits)")

### Embed Badge

![Health badge](/badges/drarok-konform/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

281.8k](/packages/webkinder-sproutset)

PHPackages © 2026

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