diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-18 17:50:11 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-01-26 11:34:14 +0100 |
commit | 6c50a6ccceecf54850e62c312ab2397b84d89ab4 (patch) | |
tree | 3205aa447930eab020ea04bf00082880abec5001 /application/render/PageBuilder.php | |
parent | 1410dce2db310e71b5e683b0871c2f28d8807844 (diff) | |
download | Shaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.tar.gz Shaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.tar.zst Shaarli-6c50a6ccceecf54850e62c312ab2397b84d89ab4.zip |
Render login page through Slim controller
Diffstat (limited to 'application/render/PageBuilder.php')
-rw-r--r-- | application/render/PageBuilder.php | 17 |
1 files changed, 17 insertions, 0 deletions
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 | |||
@@ -200,6 +200,23 @@ class PageBuilder | |||
200 | } | 200 | } |
201 | 201 | ||
202 | /** | 202 | /** |
203 | * Render a specific page as string (using a template file). | ||
204 | * e.g. $pb->render('picwall'); | ||
205 | * | ||
206 | * @param string $page Template filename (without extension). | ||
207 | * | ||
208 | * @return string Processed template content | ||
209 | */ | ||
210 | public function render(string $page): string | ||
211 | { | ||
212 | if ($this->tpl === false) { | ||
213 | $this->initialize(); | ||
214 | } | ||
215 | |||
216 | return $this->tpl->draw($page, true); | ||
217 | } | ||
218 | |||
219 | /** | ||
203 | * Render a 404 page (uses the template : tpl/404.tpl) | 220 | * Render a 404 page (uses the template : tpl/404.tpl) |
204 | * usage: $PAGE->render404('The link was deleted') | 221 | * usage: $PAGE->render404('The link was deleted') |
205 | * | 222 | * |