forked from ibrahimrsyd/Treehouse-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
54 lines (42 loc) · 1.25 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
$pageTitle = "Unique T-Shirts Designed By a Frog";
$section = "";
//Include config and header files
require_once("inc/config.php");
include(ROOT_PATH . "inc/model/products.php");
//IMPORTANT: Even though it is in a view file
//this line of code is CONTROLLER CODE because
//it calls the recent shirt data from the model.
$recent = get_products_recent();
include(ROOT_PATH . "inc/view/header.php");
?>
<div class="section banner">
<div class="wrapper">
<img class="hero" src="<?php echo BASE_URL ?>img/mike-the-frog.png" alt="Mike the Frog says:">
<div class="button">
<a href="<?php echo BASE_URL ?>shirts.php">
<h2>Hey, I’m Mike!</h2>
<p>Check Out My Shirts</p>
</a>
</div>
</div>
</div>
<div class="section shirts latest">
<div class="wrapper">
<h2>Mike’s Latest Shirts</h2>
<ul class="products">
<?php
include(ROOT_PATH . "inc/view/single-tshirt-list-view.html.php");
$list_view_html = "";
foreach($recent as $product) {
$list_view_html = get_list_view_html($product) . $list_view_html;
}
echo $list_view_html;
?>
</ul>
</div>
</div>
<?php
//Adding the footer
include(ROOT_PATH . "inc/view/footer.php");
?>