X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FAction.php;fp=mdref%2FAction.php;h=df974b9f1f1595d9fb48f0ad2822475874ffbb1d;hb=ba46a6cdffd56d99c191b8fa9a510cf7c6af45bd;hp=19cf9106f363c9edb6e89e1b83a9cd6fa6aa5ac0;hpb=4887931d502e44a0fe0d3fcc77f1efe72ca3dd79;p=mdref%2Fmdref diff --git a/mdref/Action.php b/mdref/Action.php index 19cf910..df974b9 100644 --- a/mdref/Action.php +++ b/mdref/Action.php @@ -29,7 +29,7 @@ class Action { * @var \http\Url */ private $baseUrl; - + /** * Initialize the reference */ @@ -44,7 +44,7 @@ class Action { function esc($txt) { return htmlspecialchars($txt); } - + /** * Create the view payload * @param \http\Controller $ctl @@ -52,8 +52,9 @@ class Action { */ private function createPayload() { $pld = new \stdClass; - + $pld->esc = "htmlspecialchars"; + $pld->anchor = [$this->reference, "formatAnchor"]; $pld->quick = [$this->reference, "formatString"]; $pld->file = [$this->reference, "formatFile"]; @@ -62,10 +63,10 @@ class Action { $pld->refs = $this->reference; $pld->baseUrl = $this->baseUrl; - + return $pld; } - + /** * Redirect to canononical url * @param string $cnn @@ -75,7 +76,7 @@ class Action { $this->response->setResponseCode(301); $this->response->send(); } - + /** * Serve index.css */ @@ -84,7 +85,7 @@ class Action { $this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.css", "r"))); $this->response->send(); } - + /** * Serve index.js */ @@ -93,7 +94,7 @@ class Action { $this->response->setBody(new \http\Message\Body(fopen(ROOT."/public/index.js", "r"))); $this->response->send(); } - + /** * Serve a preset * @param \stdClass $pld @@ -124,7 +125,7 @@ class Action { include ROOT."/views/layout.phtml"; $this->response->send(); } - + public function handle() { try { @@ -144,11 +145,11 @@ class Action { return; } } - + } catch (\Exception $e) { $pld->exception = $e; } $this->serve($pld); } -} \ No newline at end of file +}