Created
March 17, 2019 11:52
-
-
Save anaelleltd/e923fc2c2d8218802c66e0a2ced56f29 to your computer and use it in GitHub Desktop.
Controller and Master template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task: | |
1. Make a simple web site with at least 3 types of pages (you may include a landing page, a gallery page and a contact page). | |
a. All types shall share a common masthead header, footer and navigation. | |
2. Make a page controller for each page and set title, heading and other data in variables. | |
3. Make a master template for every type of page that in turn will include the smaller page parts. (All data can be considered safe | |
for this exercise, making filtering and escaping unnecessary) | |
<?php | |
include 'template/template.php'; | |
echo $header; | |
echo $nav; | |
echo $footer; | |
?> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Strawberries Inc TEMPLATE</title> | |
<link rel="stylesheet" type="text/css" href="css/strawberrystyle.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<?php include"template/template_contents.php" | |
?> | |
<?php | |
echo $header; | |
?> | |
<?php | |
echo $nav; | |
?> | |
<?php | |
echo $footer; | |
?> | |
</div> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment