1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

fix renderTemplate() function to allow data-less rendering

This commit is contained in:
glaszig 2019-08-18 23:22:43 +01:00
parent 6985322ca0
commit 5a49768614

View File

@ -578,9 +578,9 @@ function SaveTORAndVPNConfig()
/** /**
* Renders a simple PHP template * Renders a simple PHP template
*/ */
function renderTemplate($name, $data) function renderTemplate($name, $data = [])
{ {
$file = "../../templates/$name.php"; $file = realpath(dirname(__FILE__) . "/../templates/$name.php");
if (!file_exists($file)) { if (!file_exists($file)) {
return "template $name ($file) not found"; return "template $name ($file) not found";
} }