feat(bases) structure and example with components
This commit is contained in:
9
components/homepage/line.php
Normal file
9
components/homepage/line.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<div>
|
||||
<img src="/assets/lines/m.svg" width="64px" class="img-fluid mb-3">
|
||||
<img src="/assets/lines/<?php echo $line; ?>.svg" width="64px" class="img-fluid mb-3">
|
||||
|
||||
<?php
|
||||
$stop_name = "Champs elysées";
|
||||
include 'components/homepage/stop.php';
|
||||
?>
|
||||
</div>
|
||||
9
components/homepage/main.php
Normal file
9
components/homepage/main.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$line = '2';
|
||||
include 'components/homepage/line.php';
|
||||
?>
|
||||
<hr>
|
||||
<?php
|
||||
$line = '5';
|
||||
include 'components/homepage/line.php';
|
||||
?>
|
||||
18
components/homepage/stop.php
Normal file
18
components/homepage/stop.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<div>
|
||||
<p class="h5"><?php echo $stop_name; ?></p>
|
||||
<?php
|
||||
$directions = [
|
||||
[
|
||||
'direction' => 'Château de Vincennes',
|
||||
'next_departure' => '05:32',
|
||||
'following_departure' => '05:41'
|
||||
],
|
||||
[
|
||||
'direction' => 'Porte de Pantin',
|
||||
'next_departure' => '05:40',
|
||||
'following_departure' => '05:49'
|
||||
],
|
||||
];
|
||||
include 'stop_table.php';
|
||||
?>
|
||||
</div>
|
||||
20
components/homepage/stop_table.php
Normal file
20
components/homepage/stop_table.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<div>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Direction</th>
|
||||
<th>Prochain départ</th>
|
||||
<th>Prochain suivant</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($directions as $direction): ?>
|
||||
<tr>
|
||||
<td><?php echo $direction['direction']; ?></td>
|
||||
<td><?php echo $direction['next_departure']; ?></td>
|
||||
<td><?php echo $direction['following_departure']; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user