public function PreviewLinkRouteEventSubscriber::__construct in Preview Link 2.x
Same name and namespace in other branches
- 2.0.x src/EventSubscriber/PreviewLinkRouteEventSubscriber.php \Drupal\preview_link\EventSubscriber\PreviewLinkRouteEventSubscriber::__construct()
PreviewLinkRouteEventSubscriber constructor.
Parameters
\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.
\Drupal\Core\Routing\RedirectDestinationInterface $redirectDestination: Provides helpers for redirect destinations.
\Drupal\Core\StringTranslation\TranslationInterface $stringTranslation: The string translation service.
\Drupal\Core\Session\AccountInterface $currentUser: The current user.
\Psr\Log\LoggerInterface $logger: The logger channel.
File
- src/
EventSubscriber/ PreviewLinkRouteEventSubscriber.php, line 69
Class
- PreviewLinkRouteEventSubscriber
- Modifies canonical entity routing to redirect to preview link.
Namespace
Drupal\preview_link\EventSubscriberCode
public function __construct(MessengerInterface $messenger, RedirectDestinationInterface $redirectDestination, TranslationInterface $stringTranslation, AccountInterface $currentUser, LoggerInterface $logger) {
$this->messenger = $messenger;
$this->redirectDestination = $redirectDestination;
$this->stringTranslation = $stringTranslation;
$this->currentUser = $currentUser;
$this->logger = $logger;
}