Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/06/2014, 15:23
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años, 1 mes
Puntos: 292
Respuesta: Duda concepto de MVC

A grandes razgos concuerdo con @hhs solo aclarar:

En el Controller:

Código PHP:
Ver original
  1. <?php
  2. include "library-model.php";
  3.  
  4. // ..
  5. $library = new Library();
  6. $books = $library->getBooks();

y en la Vista:

Código PHP:
Ver original
  1. <table>
  2. <?php foreach($books as $book): ?>
  3.     <tr>
  4.     <td><?= $book->title(); ?></td>
  5.     <td><?= $book->publisher(); ?></td>
  6.     <td><?= $book->isbn(); ?></td>
  7.     <tr>    
  8. <?php endforeach; ?>
  9. </table>
__________________
Salu2!

Última edición por Italico76; 19/06/2014 a las 15:53