Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Allow set Form::setPreferFormInputFilter via options #5015

Closed

Conversation

thestanislav
Copy link
Contributor

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

@Ocramius
Copy link
Member

@thestanislav can you add simple coverage for this one?

@thestanislav
Copy link
Contributor Author

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 added a commit that referenced this pull request Aug 26, 2013
Allow set Form::setPreferFormInputFilter via options
weierophinney added a commit that referenced this pull request Aug 26, 2013
- Added tests to demonstrate that preferFormInputFilter flag can now be set via
  options and factory implementations.
weierophinney added a commit that referenced this pull request Aug 26, 2013
@ghost ghost assigned weierophinney Aug 26, 2013
@weierophinney
Copy link
Member

I added unit tests on merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants