Skip to content

Commit 59b1a8e

Browse files
committed
Created the fruits view
1 parent 6efb62a commit 59b1a8e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

app/views/fruits.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<h1>FRUIT PAGE</h1>
2+
3+
<table>
4+
<tr>
5+
<th>Id</th>
6+
<th>naam</th>
7+
<th>kleur</th>
8+
<th>prijs</th>
9+
</tr>
10+
<?php
11+
foreach ($data['fruits'] as $fruit):
12+
$fruit = (object)$fruit; // to object because ['this'] sucks
13+
14+
echo "
15+
<tr>
16+
<th>{$fruit->id}</th>
17+
<td>{$fruit->name}</td>
18+
<td>{$fruit->color}</td>
19+
<td>€{$fruit->price}</td>
20+
</tr>
21+
";
22+
endforeach;
23+
?>
24+
</table>

0 commit comments

Comments
 (0)