Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/06/2005, 07:40
Spyn_ET
 
Fecha de Ingreso: diciembre-2003
Mensajes: 218
Antigüedad: 20 años, 4 meses
Puntos: 0
Bueno si te sirve de algo mira como lo hice yo.

Espero q te sirva.

Estructura

/index.php (Donde cargo el objeto template)
/class.php (La clase de Templates)
/themes/header.html (Uno de los ficheros HTML).
...

index.php
Código PHP:
<?php

// include template parser class

require_once('class.php');

// define class parameters

$tags=array('title'=>'Template System',
            
'navbar'=>'navbar.html',
            
'footer'=>'pie.html');

// instantiate a new template parser object specifying a cache file valid for 2 hours

$tp=new SpynTPL('themes/');
//$tp->activaCache();
$tp->Fichero('header.html');
$tp->Asigna($tags);        //Asignamos Array
$tags=array('title'=>'Template Sy',
            
'navbar'=>'navbar.html',
            
'footer'=>'pie.html');
$tp->Asigna($tags);        //Asignamos Array
$tp->Asigna('pie',"ESTO ES EL PIE"); // Asignamos una variable
//$tp->Fichero('noticia.html');

// display finished page

echo $tp->Muestra();

?>
header.html
Código PHP:
<html>
<
head>
<
title>{title}</title>
</
head>
<
body bgcolor="#d6d6d8">
<
center>
<
table width="760"  border="1" cellspacing="0" cellpadding="0" height="500">
  <
tr>
    <
th background="{tpldir}images/imgLogo.jpg" height="200" align="center" valign="middle">
        <
font size="+4" color="#FFFFFF">{title}</font><br><font size="-2">{slogan}</font></th>
  </
tr>
<
block
<
tr>
<
td>{title} --> {title}</td>
</
tr>
</
block>
  <
div id="navbar">{navbar}</div>
{
footer
Lo q tengo es una variable predefinida por defecto al crear el template q es la ubicacion del template. Aunq yo no hago includes de html.
Un saludo.
__________________
SymbianForever
SymbianForever.com, todo sobre y para tu symbian
aNieto2K | Themes para WordPress
De todo un poco