Skip to content

Instantly share code, notes, and snippets.

@anaelleltd
Created March 17, 2019 11:52
Show Gist options
  • Save anaelleltd/e923fc2c2d8218802c66e0a2ced56f29 to your computer and use it in GitHub Desktop.
Save anaelleltd/e923fc2c2d8218802c66e0a2ced56f29 to your computer and use it in GitHub Desktop.
Controller and Master template
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