/** * Render with the current document * @return string */ public function render() { if ($this->document) { // This gets us the document in the api browser: $url = $this->document->getHref(); /** * This is wrong. The URL is: * https://repo.prismic.io/documents~id=:id */ $url = parse_url($url); $url = sprintf('%s://%s/documents~id=%s', $url['scheme'], $url['host'], $this->document->getId()); return sprintf($this->template, $url, $this->linkText); } return ''; }