Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- El código es`
- cargar.phtml
- <?php
- //incluye la clase Libro y CrudLibro
- require_once('Models/Libro.php');
- require_once('Controllers/LibroController.php');
- $libro= new Libros();
- $crud= new LibroController();
- //obtiene todos los libros con el método mostrar de la clase crud
- $listaLibros=$Libros->CargarDatos();
- ?>
- <html>
- <head>
- <title>Mostrar Libros</title>
- </head>
- <body>
- <table border=1>
- <head>
- <td>Nombre</td>
- <td>Autor</td>
- <td>Edicion</td>
- </head>
- <body>
- <?php foreach ($listaLibros as $Libro) {?>
- <tr>
- <td><?php echo $libro->getautor() ?></td>
- <td><?php echo $libro->gettitulo() ?></td>
- <td><?php echo $libro->getId()?> </td>
- </tr>
- <?php }?>
- </body>
- </table>
- <a href="index.php">Volver</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement