Reputation: 2910
Hi I am new to symfony2 and while I was reading the documentation I could not figure out how
public function buildForm(FormBuilderInterface $builder, array $options)
is called from within the TaskType class (in the example) using the helper createForm() in the controller.
I looked into the FormFactory.php file and I could see how the function getName() is called but nowhere the buildForm().
I know it is not really important in order to code a form but I would like to know so as to get a better grasp of what I am doing and why.
Thanks, idipous
Upvotes: 0
Views: 214
Reputation: 3353
Around line 280 in \Symfony\Component\Form\FormFactory
there is the line:
$type->buildForm($builder, $options);
and a little lower is:
$typeExtension->buildForm($builder, $options);
Around line 124 \Symfony\Component\Form\ResolvedFormType
in function createBuilder:
$this->buildForm($builder, $options);
and a number of other places in this file.
This is used in \Symfony\Component\Form\FormFactory
on line 165 in function addType:
$this->registry->addType($this->resolvedTypeFactory->createResolvedType(
$type,
array(),
$parentType ? $this->registry->getType($parentType) : null
));
Upvotes: 1