public function issue() { if ($this->nextUrl) { Logger::get()->debug("Redirecting to {$this->nextUrl}..."); $this->addHeader('Location', $this->nextUrl); } else { throw new \InvalidArgumentException('No redirection URL has been set.'); } parent::issue(); }
public function issue() { parent::issue(); $data = $this->getData(); // If there is only one element, don't output the key, just the value. if (count($data) == 1) { $data = current($data); } // Output the JSON. echo json_encode($data); }
public function issue() { $continue = parent::issue(); if ($continue) { $xmlOutput = new \SimpleXMLElement('<response source="eix"/>'); array_walk_recursive($this->getData(), function ($value, $key) use(&$xmlOutput) { $xmlOutput->addChild($key, $value); }); echo $xmlOutput->asXML(); } return $continue; }
public function issue() { // Make the image last in the cache for at least a day. $this->addHeader('Cache-Control', '3600'); // Output headers. parent::issue(); // Check whether the image needs to be resized. $this->checkForResize(); if ($this->image instanceof \Imagick) { echo $this->image; } elseif ($this->fileName) { if (is_readable($this->fileName)) { readfile($this->fileName); } else { throw new NotFoundException("Image not found in {$this->fileName}"); } } else { throw new BadRequestException('No image has been set.'); } }
public function issue() { // Output headers. parent::issue(); $this->setData('page', array('title' => @implode(' — ', $this->titleParts), 'template' => str_replace(array('.', '/'), '_', $this->templateId), 'contentType' => $this->getContentType(), 'url' => $this->getRequest() ? $this->getRequest()->getCurrentUrl() : '')); // If there are status messages left in the session by a Redirection // response, fetch them... $statusMessages = @$_SESSION['messages']['status']; // ... remove them from the session... // ... and add them to the page status. if (is_array($statusMessages)) { unset($_SESSION['messages']['status']); $this->addData('status', $statusMessages); } // Provide a hook for any custom data to be added to the response before // the latter being issued. $this->setCustomData(); // Now output the page. $medium = new Media\XslPage($this->templateId, $this->getData()); $medium->render(); }