You are here

public function GoogleAdwordsPathCodeDeleteForm::buildForm in Google AdWords Conversion Tracking 8

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 FormInterface::buildForm

File

modules/google_adwords_path/src/Form/GoogleAdwordsPathCodeDeleteForm.php, line 24
Contains \Drupal\google_adwords_path\Form\GoogleAdwordsPathCodeDeleteForm.

Class

GoogleAdwordsPathCodeDeleteForm

Namespace

Drupal\google_adwords_path\Form

Code

public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state, $cid = NULL) {
  $form = [];
  $path = 'admin/config/system/google_adwords/path';
  $code = google_adwords_path_load_code_by_cid($cid);
  $form['cid'] = [
    '#type' => 'value',
    '#value' => $code['cid'],
  ];
  $form['name'] = [
    '#type' => 'value',
    '#value' => $code['name'],
  ];
  return confirm_form($form, t('Are you sure you want to delete %name?', [
    '%name' => $code['name'],
  ]), $path);
}