예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $selection = $form_state->getValue('selection');
     $entity_type = $form_state->getValue('entity_type');
     $entity = $this->getEntityFromSelection($entity_type, $selection);
     $this->staticContext = ['label' => $form_state->getValue('label'), 'type' => 'entity:' . $entity_type, 'value' => $entity->uuid()];
     $this->page->setStaticContext($form_state->getValue('machine_name'), $this->staticContext);
     $this->page->save();
     // Set the submission message.
     drupal_set_message($this->submitMessageText());
     $form_state->setRedirectUrl($this->page->urlInfo('edit-form'));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getCancelUrl()
 {
     return $this->page->urlInfo('edit-form');
 }