Skip to content

Instantly share code, notes, and snippets.

@marekkalnik
Created January 23, 2013 10:50
Show Gist options
  • Select an option

  • Save marekkalnik/4604331 to your computer and use it in GitHub Desktop.

Select an option

Save marekkalnik/4604331 to your computer and use it in GitHub Desktop.
Symfony2 Forms: remove an inherited field
<?php
class AccountCreationType eextends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('partner_opt_in')
->remove('global_opt_in');
}
public function getParent()
{
return 'site_account_creation'; // defini un champ 'global_opt_in'
}
public function getName()
{
return 'partner_account_creation';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment