Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/04/2009, 15:11
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Método estructura formulario.

Mientras tu en tu contructor hagas: $this->nombres = ''; al pasarlo por isset() en cualquier método va a dar true, es por eso mi comentario, lo que sí va más a doc es empty($this->nombres).

Si quieres ver un buen ejemplo implementado ve Zend_View es un componente de Zend_Framework encargado de separar el código PHP de las plantillas y te permite hacer cosas básicas como:
Código php:
Ver original
  1. $data = array(
  2.     array(
  3.         'author' => 'Hernando de Soto',
  4.         'title' => 'The Mystery of Capitalism'
  5.     ),
  6.     array(
  7.         'author' => 'Henry Hazlitt',
  8.         'title' => 'Economics in One Lesson'
  9.     ),
  10.     array(
  11.         'author' => 'Milton Friedman',
  12.         'title' => 'Free to Choose'
  13.     )
  14. );
  15.  
  16. $view = new Zend_View();
  17. $view->books = $data;
  18.  
  19. echo $view->render('booklist.php');

booklist.php:
Código php:
Ver original
  1. <?php if ($this->books) { ?>
  2.     <!-- A table of some books. -->
  3.     <table>
  4.         <tr>
  5.             <th>Author</th>
  6.             <th>Title</th>
  7.         </tr>
  8.  
  9.         <?php foreach ($this->books as $key => $val) { ?>
  10.         <tr>
  11.             <td><?php echo $this->escape($val['author']); ?></td>
  12.             <td><?php echo $this->escape($val['title']); ?></td>
  13.         </tr>
  14.         <?php } ?>
  15.  
  16.     </table>
  17.  
  18. <?php } else { ?>
  19.  
  20.     <p>There are no books to display.</p>
  21.  
  22. <?php } ?>

Saludos.