/**
   * {@inheritdoc}
   */
  public function form(array $form, FormStateInterface $form_state) {

    $form['label'] = array(
      '#type' => 'textfield',
      '#title' => $this->t('Blocktabs name'),
      '#default_value' => $this->entity->label(),
      '#required' => TRUE,
    );
    $form['name'] = array(
      '#type' => 'machine_name',
      '#machine_name' => array(
        'exists' => array($this->entityStorage, 'load'),
      ),
      '#default_value' => $this->entity->id(),
      '#required' => TRUE,
    );

    return parent::form($form, $form_state);
  }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function getQuestion() {
   return $this->t('Are you sure you want to delete the @tab tab from the %blocktabs blocktabs?', array('%blocktabs' => $this->blockTabs->label(), '@tab' => $this->tab->label()));
 }