Skip to content

Skip keys with the @Ignore annotation in the FormExtractor #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Skip keys with the @Ignore annotation in the FormExtractor #162

wants to merge 2 commits into from

Conversation

hacfi
Copy link

@hacfi hacfi commented Nov 10, 2013

This small change allows you to skip keys from FormTypes by adding the @ignore annotation.

Either put the annotation before the array key or array value:

$builder->add('foo', 'bar', array('label' => /** @Ignore */ 'Foo'));

or

$builder->add('foo', 'bar', array(/** @Ignore */ 'label' => 'Foo'));

Works for FormTypes as well as Sonata Admin extensions.

It would be possible to ignore entire arrays (useful for choices for example) but this would mean duplicating code and therefore wasn’t included in the PR.

See #20

@hacfi
Copy link
Author

hacfi commented Nov 10, 2013

Travis error is due to GitHub network issues..will trigger it again in a little while.

@schmittjoh
Copy link
Owner

Could you add a small test for this?

@hacfi
Copy link
Author

hacfi commented Jun 21, 2014

Sorry..completely forgot about his. Closing in favour of #194

@hacfi hacfi closed this Jun 21, 2014
@hacfi hacfi deleted the form_skip_ignore branch June 21, 2014 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants