You are here

public function FieldValidationRuleAddForm::buildForm in Field Validation 8

Parameters

\Drupal\field_validation\FieldValidationRuleSetInterface $field_validation_rule_set: The field_validation_rule_set.

string $field_validation_rule: The field_validation_rule ID.

Return value

array The form structure.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException

Overrides FieldValidationRuleFormBase::buildForm

File

src/Form/FieldValidationRuleAddForm.php, line 44

Class

FieldValidationRuleAddForm
Provides an add form for field validation rule.

Namespace

Drupal\field_validation\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, FieldValidationRuleSetInterface $field_validation_rule_set = NULL, $field_validation_rule = NULL, $field_name = '') {
  $form = parent::buildForm($form, $form_state, $field_validation_rule_set, $field_validation_rule);
  $form['#title'] = $this
    ->t('Add %label field validation rule', [
    '%label' => $this->fieldValidationRule
      ->label(),
  ]);
  $form['actions']['submit']['#value'] = $this
    ->t('Add Rule');
  return $form;
}