Implement new template parameter
This commit is contained in:
parent
7f930ff544
commit
780df09b70
@ -2,6 +2,7 @@
|
|||||||
// This file should serve as an example showing all the current implemented features.
|
// This file should serve as an example showing all the current implemented features.
|
||||||
|
|
||||||
// Parameters that will be used in the template file
|
// 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
|
$templateParameters["title"] = "Eksempel side"; // Sets the page title
|
||||||
|
|
||||||
// Include the top of page
|
// Include the top of page
|
||||||
|
13
login.php
Normal file
13
login.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
// Parameters that will be used in the template file
|
||||||
|
$templateParameters["title"] = "Logg inn"; // Sets the page title
|
||||||
|
|
||||||
|
// Include the top of page
|
||||||
|
include_once("template/_header.php");
|
||||||
|
?>
|
||||||
|
<h1>Logg inn</h1>
|
||||||
|
<p>Her kan du logge inn</p>
|
||||||
|
<?php
|
||||||
|
// Include the rest of the page
|
||||||
|
include_once("template/_footer.php");
|
||||||
|
?>
|
@ -1,3 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
if ($templateParameters["render"] === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
?>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,9 @@ if ((strlen($templateUrlPrefix) > 1)) {
|
|||||||
$templateUrlPrefix = $templateUrlPrefix . DIRECTORY_SEPARATOR;
|
$templateUrlPrefix = $templateUrlPrefix . DIRECTORY_SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($templateParameters["render"] === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@ -39,6 +42,7 @@ if ((strlen($templateUrlPrefix) > 1)) {
|
|||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<?=$templateUrlPrefix;?>">Forside</a></li>
|
<li><a href="<?=$templateUrlPrefix;?>">Forside</a></li>
|
||||||
|
<li><a href="<?=$templateUrlPrefix;?>login.php">Logg inn</a></li>
|
||||||
<li><a href="<?=$templateUrlPrefix;?>example.php">Eksempel</a></li>
|
<li><a href="<?=$templateUrlPrefix;?>example.php">Eksempel</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
Reference in New Issue
Block a user