1 | <?php |
2 | |
3 | require_once __DIR__ . "/../lib/php/ejecutaServicio.php"; |
4 | require_once __DIR__ . "/bd/pasatiempoConsulta.php"; |
5 | |
6 | ejecutaServicio(function () { |
7 | $lista = pasatiempoConsulta(); |
8 | $render = ""; |
9 | foreach ($lista as $modelo) { |
10 | $id = htmlentities($modelo->id); |
11 | $nombre = htmlentities($modelo->nombre); |
12 | $render .= |
13 | "<li> |
14 | <p> |
15 | <a href='modifica.html?id=$id'>$nombre</a> |
16 | </p> |
17 | </li>"; |
18 | } |
19 | return ["lista" => ["innerHTML" => $render]]; |
20 | }); |
21 |