Skip to content

Instantly share code, notes, and snippets.

@gzankevich
Created August 9, 2012 09:24
Show Gist options
  • Save gzankevich/3302637 to your computer and use it in GitHub Desktop.
Save gzankevich/3302637 to your computer and use it in GitHub Desktop.
class LeadMatchingOfficeViewingsType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('viewings', 'collection', array(
'type' => new ViewingsListType()
))
;
}
public function getName()
{
return 'phoenix_crmbundle_leadmatchingofficeviewingstype';
}
}
class LeadViewingsType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('lead_matching_offices', 'collection', array(
'type' => new LeadMatchingOfficeViewingsType()
))
;
}
public function getName()
{
return 'phoenix_crmbundle_leadviewings';
}
}
var_dump([errors])
-------------------
array (size=2)
0 => string 'This form should not contain extra fields' (length=41)
'phoenix_crmbundle_leadviewings' =>
array (size=1)
0 => string 'This form should not contain extra fields' (length=41)
var_dump($request->request->all())
----------------------------------
array (size=1)
'phoenix_crmbundle_leadviewings' =>
array (size=2)
'_token' => string '520f9d6316f43313bdb1ae6eee250ee4925c5593' (length=40)
'lead_matching_offices' =>
array (size=1)
0 =>
array (size=1)
'viewings' =>
array (size=1)
0 =>
array (size=1)
'cancel' => string '1' (length=1)
class ViewingsListType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('cancel', 'checkbox', array(
'property_path' => false
))
;
}
public function getName()
{
return 'phoenix_crmbundle_viewingslisttype';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment