Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/02/2010, 13:04
Avatar de pateketrueke
pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: uso de plantillas con php

si, veamos... eso quiere decir separar todo en partes, módulos, plantillas, etc...

por ejemplo en un script solo procesas los datos, defines tus variables u posteriormente incluyes la plantilla...

Código PHP:
$books = array(
    array(
        
'author' => 'Hernando de Soto',
        
'title' => 'The Mystery of Capitalism'
    
),
    array(
        
'author' => 'Henry Hazlitt',
        
'title' => 'Economics in One Lesson'
    
),
    array(
        
'author' => 'Milton Friedman',
        
'title' => 'Free to Choose'
    
)
);

include 
'view.php'

view.php
Código PHP:
<table>
        <tr>
            <th>Author</th>
            <th>Title</th>
        </tr>
        <?php foreach ($books as $key => $val) { ?>
        <tr>
            <td><?php echo htmlspecialchars($val['author']) ?></td>
            <td><?php echo htmlspecialchars($val['title']) ?></td>
        </tr>
        <?php ?>
    </table>
http://framework.zend.com/manual/en/...roduction.html

aunque el ejemplo corresponde al objeto Zend_View de Zend Framework, el concepto es idéntico... ;)
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.