You are here

class FancyLoginRedirectCommand in Fancy Login 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Ajax/FancyLoginRedirectCommand.php \Drupal\fancy_login\Ajax\FancyLoginRedirectCommand

Defines the redirect command.

Hierarchy

Expanded class hierarchy of FancyLoginRedirectCommand

1 file declares its use of FancyLoginRedirectCommand
fancy_login.module in ./fancy_login.module
Holds hooks for the Fancy Login module.

File

src/Ajax/FancyLoginRedirectCommand.php, line 10

Namespace

Drupal\fancy_login\Ajax
View source
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,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FancyLoginRedirectCommand::$closePopup protected property A boolean indicating whether or not the popup should be closed first.
FancyLoginRedirectCommand::$destination protected property The redirect destination.
FancyLoginRedirectCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
FancyLoginRedirectCommand::__construct public function Constructs a FancyLoginRedirectCommand object.