You are here

FancyLoginRedirectCommand.php in Fancy Login 3.0.x

Same filename and directory in other branches
  1. 8.2 src/Ajax/FancyLoginRedirectCommand.php

File

src/Ajax/FancyLoginRedirectCommand.php
View source
<?php

namespace Drupal\fancy_login\Ajax;

use Drupal\Core\Ajax\CommandInterface;

/**
 * Defines the redirect command.
 */
class FancyLoginRedirectCommand implements CommandInterface {

  /**
   * A boolean indicating whether or not the popup should be closed first.
   *
   * @var bool
   */
  protected $closePopup;

  /**
   * The redirect destination.
   *
   * @var string
   */
  protected $destination;

  /**
   * Constructs a FancyLoginRedirectCommand object.
   *
   * @param bool $closePopup
   *   A boolean indicating whether or not the popup should be closed before
   *   redirecting.
   * @param string $destination
   *   The redirect destination.
   */
  public function __construct($closePopup, $destination) {
    $this->closePopup = $closePopup;
    $this->destination = $destination;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'fancyLoginRedirect',
      'closePopup' => $this->closePopup,
      'destination' => $this->destination,
    ];
  }

}

Classes

Namesort descending Description
FancyLoginRedirectCommand Defines the redirect command.