You are here

public function CustomServicesDeleteForm::buildForm in Shorten URLs 8.2

Same name and namespace in other branches
  1. 8 modules/shorten_cs/src/Form/CustomServicesDeleteForm.php \Drupal\shorten_cs\Form\CustomServicesDeleteForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

modules/shorten_cs/src/Form/CustomServicesDeleteForm.php, line 94

Class

CustomServicesDeleteForm
Settings form.

Namespace

Drupal\shorten_cs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, Request $request = NULL, $service = NULL) {
  $item = $this->database
    ->select('shorten_cs', 's')
    ->fields('s')
    ->condition('sid', intval($service))
    ->execute()
    ->fetchAssoc();
  $this->id = $item['name'];
  $form['service'] = [
    '#type' => 'value',
    '#value' => $item['name'],
  ];
  return parent::buildForm($form, $form_state);
}