You are here

public function CustomServicesDeleteForm::buildForm in Shorten URLs 8

Same name and namespace in other branches
  1. 8.2 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 62

Class

CustomServicesDeleteForm
Settings form.

Namespace

Drupal\shorten_cs\Form

Code

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