Allow set Form::setPreferFormInputFilter via options #5015

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@thestanislav
Contributor

Allow set setPreferFormInputFilter options while building forms by FormFactory using form spec.

@Ocramius
Member

@thestanislav can you add simple coverage for this one?

@thestanislav
Contributor

This can be used to create forms via form factory

use Zend\Form\Factory;

$factory = new Factory();
$form    = $factory->createForm(array(
    'options' => array(
        'prefer_form_input_filter' => true
    ),
    'elements' => array(
        array(
            'spec' => array(
                'name' => 'name',
                'options' => array(
                    'label' => 'Your name',
                ),
                'type'  => 'Text',
            )
        ),
        array(
            'spec' => array(
                'type' => 'Zend\Form\Element\Email',
                'name' => 'email',
                'options' => array(
                    'label' => 'Your email address',
                )
            ),
        )
    ),
));
@weierophinney weierophinney added a commit that referenced this pull request Aug 26, 2013
@weierophinney weierophinney [#5015] Added unit tests
- Added tests to demonstrate that preferFormInputFilter flag can now be set via
  options and factory implementations.
d7eba45
@weierophinney weierophinney added a commit that referenced this pull request Aug 26, 2013
@weierophinney weierophinney Merge branch 'hotfix/5015' into develop
Close #5015
12252b6
@weierophinney weierophinney added a commit that closed this pull request Aug 26, 2013
@weierophinney weierophinney Merge branch 'hotfix/5015'
Close #5015
98b5b85
@weierophinney
Member

I added unit tests on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment