/**
  * Transform the buttons in the given form into a array that can easily be used by twig.
  *
  * @param FormRuleContext $context
  * @return array
  */
 protected function buttonsViewData(FormRuleContext $context)
 {
     $buttonNames = $context->getButtons();
     $buttons = array();
     foreach ($buttonNames as $name) {
         $groups = $context->getGroup($name);
         $buttons[] = array('name' => $name, 'cancel' => count($groups) === 0, 'validation_groups' => $groups);
     }
     return $buttons;
 }
 public function getGroup($view)
 {
     $name = FormHelper::getFormName($view);
     return parent::getGroup($name);
 }