X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Frender%2FPageBuilder.php;h=f4fefda84f448297374fc1b5e47ad159f44c1bae;hb=6c50a6ccceecf54850e62c312ab2397b84d89ab4;hp=65e85aaf4918c1f29c85af30f9560dd596184cef;hpb=1410dce2db310e71b5e683b0871c2f28d8807844;p=github%2Fshaarli%2FShaarli.git diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php index 65e85aaf..f4fefda8 100644 --- a/application/render/PageBuilder.php +++ b/application/render/PageBuilder.php @@ -199,6 +199,23 @@ class PageBuilder $this->tpl->draw($page); } + /** + * Render a specific page as string (using a template file). + * e.g. $pb->render('picwall'); + * + * @param string $page Template filename (without extension). + * + * @return string Processed template content + */ + public function render(string $page): string + { + if ($this->tpl === false) { + $this->initialize(); + } + + return $this->tpl->draw($page, true); + } + /** * Render a 404 page (uses the template : tpl/404.tpl) * usage: $PAGE->render404('The link was deleted')