/**
  * {@inheritdoc}
  */
 public function buildView(FormView $view, FormInterface $form, array $options)
 {
     parent::buildView($view, $form, $options);
     if (!$options['select2']['enabled']) {
         return;
     }
     /* @var FormBuilderInterface $selectorBuilder */
     $selectorBuilder = $form->getConfig()->getAttribute('selector');
     $selectorBuilder->setData($form->getData());
     $selector = $selectorBuilder->getForm();
     $selectorView = $selector->createView($view);
     $selectorView->vars = array_replace($selectorView->vars, array('id' => $view->vars['id'], 'full_name' => $view->vars['full_name'] . '[]'));
     $view->vars = array_replace($view->vars, array('selector' => $selectorView));
 }