This section provides an overview of what Symfony2 is and why a developer might want to use it.
It should also mention any large subjects within Symfony2 and link out to the related topics. Since the Documentation for Symfony2 is new, you may need to create initial versions of those related topics.
API documentation links (master):
Request object contains several significant data like current Locale and matched Controller. You can use and manage them by HttpKernel events. For reliable understanding of Request-Responce live cycle read this HttpKernel Component doc page (very helpful!).
When you create a form class the form fields are added in the public function buildForm(FormBuilderInterface $builder, array $options) {...}
function. The $options
parameter includes a set of default options such as attr
and label
. To enable your custom options to be available in the form class the options need to be initialized in configureOptions(OptionsResolver $resolver)
So for our real-world example:
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Household',
'disabledOptions' => [],
));
}