当前位置: 首页>>代码示例>>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;未经允许,请勿转载。