/** * @param Form $form */ public function configure(Form $form) { $form->addHidden('provider')->setValue($this->provider); $form['parameters'] = $this->securityManager->getLoginProviderByName($this->provider)->getFormContainer(); $form->addSaveButton('Sign in')->getControlPrototype()->class[] = 'btn-primary'; $form->addSubmit('cancel', 'Cancel')->setValidationScope(FALSE); }
/** * @param Form $form */ public function configure(Form $form) { $types = array(); foreach ($form->data->types as $entity) { $types[$entity->id] = (string) $entity; } $c = count($types); if ($c === 0) { $typeControl = $form->addHidden('type')->setDefaultValue(NULL); } elseif ($c === 1) { $typeControl = $form->addHidden('type')->setDefaultValue(key($types)); $typeControl->addRule($form::FILLED); } else { $typeControl = $form->addSelect('type', 'Type', $types); $typeControl->addRule($form::FILLED); } $form->addText('sum', 'Sum')->addRule($form::FILLED)->addRule($form::INTEGER)->setDefaultValue(1); $form->addSubmit('order', 'Order'); }
public function configure(Form $form) { $form->addHidden('sort'); $form->addSaveButton('Store layout'); }