]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/render/PageBuilder.php
Render login page through Slim controller
[github/shaarli/Shaarli.git] / application / render / PageBuilder.php
index 65e85aaf4918c1f29c85af30f9560dd596184cef..f4fefda84f448297374fc1b5e47ad159f44c1bae 100644 (file)
@@ -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')