$pld->ref = $this->baseUrl->pathinfo(
$this->baseUrl->mod($this->request->getRequestUrl()));
+ $pld->markup = function($page) use($pld) {
+ return $this->reference->getFormatter()->markup($page, $pld);
+ };
+
$pld->refs = $this->reference;
$pld->baseUrl = $this->baseUrl;
include ROOT."/views/layout.phtml";
$this->response->addHeader("Link", "<" . $this->baseUrl->path . "index.css>; rel=preload; as=style");
$this->response->addHeader("Link", "<" . $this->baseUrl->path . "index.js>; rel=preload; as=script");
+ if (isset($exception) && $exception->getCode()) {
+ $this->response->setResponseCode($exception->getCode());
+ }
if (is_resource($this->output)) {
$this->response->send($this->output);
} else {
try {
$pld = $this->createPayload();
- if (strlen($pld->ref)) {
+ if (isset($pld->ref) && strlen($pld->ref)) {
$cnn = null;
if (($repo = $this->reference->getRepoForEntry($pld->ref, $cnn))) {
- if (strlen($cnn)) {
+ if (isset($cnn) && strlen($cnn)) {
/* redirect */
$this->serveCanonical($cnn);
return;