/**
  * @inheritDoc
  */
 public function __invoke(ServerRequestInterface $request, ResponseInterface $response, PayloadInterface $payload)
 {
     $location = $payload->getSetting('redirect');
     if (!empty($location)) {
         $response = $response->withHeader('Location', $location);
     }
     return $response;
 }
Exemple #2
0
 /**
  * @param PayloadInterface $payload
  *
  * @return string
  */
 private function render(PayloadInterface $payload)
 {
     $template = $payload->getSetting('template');
     $output = $payload->getOutput();
     return $this->engine->render($template, $output);
 }