Created
June 4, 2014 19:06
-
-
Save EclipseGc/f9a8d46101f462bca857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HttpStatusCodePageVariant { | |
public function render() { | |
$status_code = $this->configuration['status_code']; | |
$dispatcher = \Drupal::service('event_dispatcher'); | |
$event = new PageManagerViewEvent(); | |
$event->setStatusCode($status_code); | |
$dispatcher->dispatch(PageManagerEvents::VIEW, $event); | |
return new Response($event->getContent(), $event->getStatusCode()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment