Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/06/2005, 02:06
Spyn_ET
 
Fecha de Ingreso: diciembre-2003
Mensajes: 218
Antigüedad: 20 años, 4 meses
Puntos: 0
Ya lo se, se q no es bueno ni recomendable, pero es q necesito hacerlo asi, ya q luego muestro recorriendo todo el array.

Os explico, estoy desarrollando un motor de templates y tengo problemas con los bloques, osea las zonas q qremos repetir X veces.

Lo q hago es genero el html con dreamweaver y para los bloques implemento lo siguiente.

header.html
Código PHP:
<table>
<
block>
<
tr>
  <
td>{titulo}</td><td>{texto}</td>
</
tr>
</
block>
</
table
Luego en el codigo php (index.php)

index.php
Código PHP:
include('class-tpl.php');
$html = new SpynTPL("themes/");
$html->Fichero("header.html");

$result $db->query("SELECT * FROM ".PREFIX."_noticias");
$aNot = array();
while (
$row $db->fetch_row($result))
{
    
$aNot array_merge($aNot,array ( 'titulo' => $row[0], 'texto' =>$row[2]));
}
$html->Asigna($aNot); 
Y deberia salir esto.

salida
Código PHP:
<table>
<
tr>
  <
td>TITULO 1</td><td>TEXTO1</td>
</
tr>
<
tr>
  <
td>TITULO 2</td><td>TEXTO2</td>
</
tr>
</
table
__________________
SymbianForever
SymbianForever.com, todo sobre y para tu symbian
aNieto2K | Themes para WordPress
De todo un poco