commerce-8.x-2.8/tests/modules/commerce_test/src/Form/RedirectForm.php

tests/modules/commerce_test/src/Form/RedirectForm.php
<?php

namespace Drupal\commerce_test\Form;

use Drupal\commerce\Response\NeedsRedirectException;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Redirects the user to drupal.org.
 */
class RedirectForm extends FormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'commerce_test_redirect_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    throw new NeedsRedirectException('https://www.drupal.org/');
  }

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

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc