Skip to content

Commit cd3bea0

Browse files
committed
8. Created the country index view
1 parent c4b32a9 commit cd3bea0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

app/views/countries/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h1>Countries:</h1>
2+
3+
<table>
4+
<thead>
5+
<tr>
6+
<th>Id</th>
7+
<th>Land</th>
8+
<th>Hoofdstad</th>
9+
<th>Continent</th>
10+
<th>Aantal inwoners</th>
11+
</tr>
12+
</thead>
13+
<tbody>
14+
<?php
15+
foreach($data["countries"] as $country) {
16+
echo "
17+
<tr>
18+
<th>{$country->id}</th>
19+
<td>{$country->name}</td>
20+
<td>{$country->capitalCity}</td>
21+
<td>{$country->continent}</td>
22+
<td>{$country->population}</td>
23+
</tr>
24+
";
25+
}
26+
?>
27+
</tbody>
28+
</table>

0 commit comments

Comments
 (0)