PHPackages                             zored/reverse-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. zored/reverse-form

ActiveModule

zored/reverse-form
==================

Rendering ZF3 forms with viewscripts. It can be extended to render with other frameworks then Twitter Bootstrap.

1.0.0(8y ago)03MITHTMLPHP &gt;=7.1

Since Nov 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zored/ReverseForm)[ Packagist](https://packagist.org/packages/zored/reverse-form)[ Docs](https://github.com/silvester/ReverseForm)[ RSS](/packages/zored-reverse-form/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

ReverseForm
===========

[](#reverseform)

This is an early alpha, things do work but may be changed how they work in future.

Uni-Form form demo at:

Twitter Bootstrap form demo at:

Introduction
------------

[](#introduction)

ReverseForm is a form rendering module. It creates the renderer objects through a view helper. It also provides an object which extends Zend\\Form\\Element called ReverseForm\\ExtendedElement which will be usefull to create more complicated elements faster.

Goals
-----

[](#goals)

- Support other frameworks for rendering forms like mobile ones.
- Add an unified way of creating new elements. It should take care of the JS, CSS and configuration part of an element.
- Elements should honor localization.

Installation with Composer
--------------------------

[](#installation-with-composer)

1. Add this project in your `composer.json`:

```
    "require": {
        "zored/reverse-form": "0.1",
    }
```

2. Fetch the repository with composer:

```
$ php composer.phar update
```

3. Enable it in your `config/application.config.php` file:

```
return array(
    'modules' => array(
        // ...
        'ReverseForm',
    ),
    // ...
);
```

Form Renderers
--------------

[](#form-renderers)

Currently I provide 2 types of renderers, but it is simple to create other renderers by extending the ReverseForm\\Renderer. Before you start take a look at the `/config/module.config.php` all of the options are there.

- ReverseForm\\Renderer\\Uniform renders the form with extra markup to make it work with [Uni-Form](http://sprawsm.com/uni-form/).
- ReverseForm\\Renderer\\Bootstrap obviously renders [Twitter Bootstrap](http://twitter.github.com/bootstrap/).

### Uniform Renderer

[](#uniform-renderer)

```
    $this->form->setAttribute('action', $this->url('album', array('action' => 'test-form')));
    $formRenderer = $this->formRenderer($form, 'renderer.uniform', 'vertical'); // vertical or horizontal
    $formRenderer->prepare(); // this is how you create it in your viewscript
```

Get your css from [Uni-Form](http://sprawsm.com/uni-form/). Check the path to load the files in the module\_config.php.

### Bootstrap Renderer

[](#bootstrap-renderer)

```
    $this->form->setAttribute('action', $this->url('album', array('action' => 'test-form')));
    $formRenderer = $this->formRenderer($form, 'renderer.bootstrap', 'vertical'); // vertical or horizontal
    $formRenderer->prepare(); // this is how you create it in your viewscript
```

It does not auto load any css or js files in to your view. If you need to load extra files you can do it from the configuration.

Usage
-----

[](#usage)

### In your view script do:

[](#in-your-view-script-do)

```
	Form Testing
