當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormStateInterface::setRedirectUrl方法代碼示例

本文整理匯總了PHP中Drupal\Core\Form\FormStateInterface::setRedirectUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormStateInterface::setRedirectUrl方法的具體用法?PHP FormStateInterface::setRedirectUrl怎麽用?PHP FormStateInterface::setRedirectUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Form\FormStateInterface的用法示例。


在下文中一共展示了FormStateInterface::setRedirectUrl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     $entity = $this->entity;
     $status = $entity->save();
     switch ($status) {
         case SAVED_NEW:
             drupal_set_message($this->t('Created %label.', ['%label' => $entity->label()]));
             $form_state->setRedirectUrl($entity->toUrl('edit-form'));
             break;
         default:
             drupal_set_message($this->t('Saved %label.', ['%label' => $entity->label()]));
             $form_state->setRedirectUrl($entity->toUrl('collection'));
             break;
     }
 }
開發者ID:r-daneelolivaw,項目名稱:chalk,代碼行數:18,代碼來源:WrapperEntityForm.php

示例2: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $component = $this->rulesUiHandler->getComponent();
     $component->getExpression()->deleteExpression($this->uuid);
     $this->rulesUiHandler->updateComponent($component);
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:Progressable,項目名稱:openway8,代碼行數:10,代碼來源:DeleteExpressionForm.php

示例3: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->page->removeAccessCondition($this->accessCondition->getConfiguration()['uuid']);
     $this->page->save();
     drupal_set_message($this->t('The access condition %name has been removed.', ['%name' => $this->accessCondition->getPluginDefinition()['label']]));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:10,代碼來源:AccessConditionDeleteForm.php

示例4: submit

 /**
  * {@inheritdoc}
  */
 public function submit(array $form, FormStateInterface $form_state)
 {
     $this->entity->delete();
     $this->logger('user')->notice('Role %name has been deleted.', array('%name' => $this->entity->label()));
     drupal_set_message($this->t('Role %name has been deleted.', array('%name' => $this->entity->label())));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:UserRoleDelete.php

示例5: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->page->removeVariant($this->displayVariant->id());
     $this->page->save();
     drupal_set_message($this->t('The display variant %name has been removed.', ['%name' => $this->displayVariant->label()]));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:pulibrary,項目名稱:recap,代碼行數:10,代碼來源:DisplayVariantDeleteForm.php

示例6: submit

 /**
  * {@inheritdoc}
  */
 public function submit(array $form, FormStateInterface $form_state)
 {
     $this->entity->delete();
     drupal_set_message(t('Custom block type %label has been deleted.', array('%label' => $this->entity->label())));
     $this->logger('block_content')->notice('Custom block type %label has been deleted.', array('%label' => $this->entity->label()));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:BlockContentTypeDeleteForm.php

示例7: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->getEntity()->delete();
     $this->logger->info('Payment status %label (@id) has been deleted.', ['@id' => $this->getEntity()->id(), '%label' => $this->getEntity()->label()]);
     drupal_set_message($this->t('%label has been deleted.', array('%label' => $this->getEntity()->label())));
     $form_state->setRedirectUrl($this->getEntity()->urlInfo('collection'));
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:10,代碼來源:PaymentStatusDeleteForm.php

示例8: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->entity->delete();
     \Drupal::service('router.builder')->setRebuildNeeded();
     drupal_set_message($this->t('Signup Form %label has been deleted.', array('%label' => $this->entity->label())));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:rafavergara,項目名稱:ddv8,代碼行數:10,代碼來源:MailchimpSignupDeleteForm.php

示例9: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $currency_locale = $this->getEntity();
     $currency_locale->delete();
     drupal_set_message($this->t('The currency locale %label has been deleted.', array('%label' => $currency_locale->label())));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:nishantkumar155,項目名稱:drupal8.crackle,代碼行數:10,代碼來源:CurrencyLocaleDeleteForm.php

示例10: submit

 /**
  * {@inheritdoc}
  */
 public function submit(array $form, FormStateInterface $form_state)
 {
     $this->entity->delete();
     drupal_set_message($this->t('Deleted vocabulary %name.', array('%name' => $this->entity->label())));
     $this->logger('taxonomy')->notice('Deleted vocabulary %name.', array('%name' => $this->entity->label()));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:VocabularyDeleteForm.php

示例11: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     if (mailchimp_campaign_delete_campaign($this->entity)) {
         drupal_set_message($this->t('MailChimp Campaign %label has been deleted.', array('%label' => $this->entity->label())));
     }
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:rafavergara,項目名稱:ddv8,代碼行數:10,代碼來源:MailchimpCampaignDeleteForm.php

示例12: save

 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     $this->termStorage->resetWeights($this->entity->id());
     drupal_set_message($this->t('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label())));
     $this->logger('taxonomy')->notice('Reset vocabulary %name to alphabetical order.', array('%name' => $this->entity->label()));
     $form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:VocabularyResetForm.php

示例13: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $entity = $this->getEntity();
     $entity->delete();
     \Drupal::logger('eck')->notice('@type: deleted %title.', array('@type' => $this->entity->bundle(), '%title' => $this->entity->label()));
     $form_state->setRedirectUrl(new Url('eck.entity.' . $this->entity->getEntityTypeId() . '.list'));
 }
開發者ID:jokas,項目名稱:d8.dev,代碼行數:10,代碼來源:EckEntityDeleteForm.php

示例14: submitForm

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    // Handle current blocks according to user's selection.
    if ($blocks = $this->getBlocksForGroup()) {
      $blocks_op = $form_state->getValue('blocks_op');
      switch ($blocks_op) {
        case static::DELETE_BLOCKS:
          $this->blockStorage()->delete($blocks);
          break;

        case static::UNSET_BLOCKS:
          $this->setBlocksGroup($blocks);
          break;

        default:
          $this->setBlocksGroup($blocks, $blocks_op);
      }
    }
    $this->entity->delete();

    drupal_set_message(
      $this->t('Deleted @type:  @label.',
        [
          '@type' => $this->entity->getEntityType()->getLabel(),
          '@label' => $this->entity->label(),
        ]
      )
    );

    $form_state->setRedirectUrl($this->getCancelUrl());
  }
開發者ID:eloiv,項目名稱:botafoc.cat,代碼行數:33,代碼來源:BlockVisibilityGroupDeleteForm.php

示例15: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->entity->set('replacementID', $form_state->getValue('replacement'));
     $this->entity->delete();
     drupal_set_message($this->t('Style %name was deleted.', array('%name' => $this->entity->label())));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:10,代碼來源:ImageStyleDeleteForm.php


注:本文中的Drupal\Core\Form\FormStateInterface::setRedirectUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。