-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
43 lines (40 loc) · 1.05 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
<?php
require __DIR__.'/header.php';
use App\Character;
use App\CharacterRepository;
use App\CharacterLog;
use App\CharacterLogRepository;
/*
if (isset($_SESSION['id'])) {
$characterRepository = new CharacterRepository($base);
$character = $characterRepository->find($_SESSION['id']);
?>
<table>
<tr>
<th>Nom du joueur</th>
<td><?= $character->getName(); ?></td>
</tr>
<tr>
<th>Point de vie</th>
<td><?= $character->getHp(); ?></td>
</tr>
<tr>
<th>Point d'action</th>
<td><?= $character->getAp(); ?></td>
</tr>
<tr>
<th>XP</th>
<td><?= $character->getExperience(); ?></td>
</tr>
<tr>
<th>Level</th>
<td><?= $character->getLevel(); ?></td>
</tr>
</table>
*/
$characters = null;
if (isset($_SESSION['id'])) {
$characters = $characterRepository->findAllWithoutMe($_SESSION['id']);
}
echo $twig->render('index.html.twig', ['characters' => $characters]);
?>