The Zend quickstart guide:

<http://framework.zend.com/manual/2.2/en/modules/zend.form.quick-start.html>

Implies that the form factory can attach the filters automatically by adding them to the configuration array, rudimentary testing demonstrates that validation is occurring, but nothing is getting passed back to the view ( formElementErrors or formRow ).
)

Factory Array

```
$this->form = array(
            'hydrator' => 'Zend\Stdlib\Hydrator\ArraySerializable',
            'elements' => array(
                array(
                    'spec' => array(
                        'name' => 'name',
                        'options' => array(
                            'label' => 'Your name',
                        ),
                        'attributes' => array(
                            'type'  => 'text'
                        ),
                    )
                ),
                array(
                    'spec' => array(
                        'type' => 'Zend\Form\Element\Email',
                        'name' => 'email',
                        'options' => array(
                            'label' => 'Your email address',
                        )
                    ),
                ),
                array(
                    'spec' => array(
                        'type' => 'Zend\Form\Element\Csrf',
                        'name' => 'security',
                    ),
                ),
                array(
                    'spec' => array(
                        'name' => 'send',
                        'attributes' => array(
                            'type'  => 'submit',
                            'value' => 'Submit',
                        ),
                    ),
                ),
            ),
            'input_filter' => array(
                'name' => array(
                    'required' => true,
                    'filters'  => array(
                        array('name' => 'Zend\Filter\StringTrim'),
                    ),

                ),
                'email' => array(
                    'required' => true,
                    'filters'  => array(
                        array('name' => 'Zend\Filter\StringTrim'),
                    ),
                    'validators' => array(
                        new Validator\EmailAddress(),
                    ),
                )
            )
        );

```

Controller

```
namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Form\Factory;

use Application\Form\Login;

class LoginController extends AbstractActionController
{
    public function indexAction()
    {
        $factory = new Factory();
        $login = new Login();

        $form = $factory->createForm($login->form);

        if ($this->getRequest()->isPost())
        { 
            $form->setData( $this->getRequest()->getPost() );

            /*
            if ($form->isValid()) 
            {
                die('valid');
            }
            else
            {
                die('invalid');
            }
            */

        }

        return(array('form' => $form));

    }

    public function loginAction()
    {

        die('login');

    }
}

```

View

```
<?php
    $form = $this -> form;
    $form -> prepare();
    $form -> setAttribute('method', 'post');
    $formLabel = $this -> plugin('formLabel');
    echo $this -> form() -> openTag($form);
    ?>

    <div class="form_element">
    <?php echo $this -> formRow($form -> get('name'));?>
    </div>

    <div class="form_element">
    <?php echo $this -> formRow($form -> get('email')); ?>
    </div>

    <?php echo $this->formElement($form -> get('security')); ?>

    <?php echo $this->formElement($form -> get('send')); ?>

    <?php echo $this->form()->closeTag(); ?>

```