From 780df09b703fe4a9c00a41f20c2f9bc0b7ad5dde Mon Sep 17 00:00:00 2001 From: Willy Date: Mon, 6 Sep 2021 09:04:29 +0200 Subject: [PATCH] Implement new template parameter --- example.php | 1 + login.php | 13 +++++++++++++ template/_footer.php | 5 +++++ template/_header.php | 4 ++++ 4 files changed, 23 insertions(+) create mode 100644 login.php diff --git a/example.php b/example.php index a5c3e90..3a59d3d 100644 --- a/example.php +++ b/example.php @@ -2,6 +2,7 @@ // This file should serve as an example showing all the current implemented features. // Parameters that will be used in the template file +$templateParameters["render"] = true; // Whether or not to render the template $templateParameters["title"] = "Eksempel side"; // Sets the page title // Include the top of page diff --git a/login.php b/login.php new file mode 100644 index 0000000..f189fb3 --- /dev/null +++ b/login.php @@ -0,0 +1,13 @@ + +

Logg inn

+

Her kan du logge inn

+ \ No newline at end of file diff --git a/template/_footer.php b/template/_footer.php index 1f63cc0..6962b21 100644 --- a/template/_footer.php +++ b/template/_footer.php @@ -1,3 +1,8 @@ + diff --git a/template/_header.php b/template/_header.php index 50bbefe..7c18a3a 100644 --- a/template/_header.php +++ b/template/_header.php @@ -7,6 +7,9 @@ if ((strlen($templateUrlPrefix) > 1)) { $templateUrlPrefix = $templateUrlPrefix . DIRECTORY_SEPARATOR; } +if ($templateParameters["render"] === false) { + return; +} ?> @@ -39,6 +42,7 @@ if ((strlen($templateUrlPrefix) > 1)) {