* @var \http\Url
*/
private $baseUrl;
-
+
/**
* Initialize the reference
*/
function esc($txt) {
return htmlspecialchars($txt);
}
-
+
/**
* Create the view payload
* @param \http\Controller $ctl
*/
private function createPayload() {
$pld = new \stdClass;
-
+
$pld->esc = "htmlspecialchars";
+ $pld->anchor = [$this->reference, "formatAnchor"];
$pld->quick = [$this->reference, "formatString"];
$pld->file = [$this->reference, "formatFile"];
$pld->refs = $this->reference;
$pld->baseUrl = $this->baseUrl;
-
+
return $pld;
}
-
+
/**
* Redirect to canononical url
* @param string $cnn
$this->response->setResponseCode(301);
$this->response->send();
}
-
+
/**
* Serve index.css
*/
$this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.css", "r")));
$this->response->send();
}
-
+
/**
* Serve index.js
*/
$this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.js", "r")));
$this->response->send();
}
-
+
/**
* Serve a preset
* @param \stdClass $pld
include ROOT."/views/layout.phtml";
$this->response->send();
}
-
+
public function handle() {
try {
return;
}
}
-
+
} catch (\Exception $e) {
$pld->exception = $e;
}
$this->serve($pld);
}
-}
\ No newline at end of file
+}