Formateo de página
En este ejemplo vamos a usar el PHP y la capacidad de definir librerías para conseguir que todas nuestras páginas tengan el mismo formato de página, incluyendo las partes comunes en librerías. Así mismo modificando la librería modificaríamos tambien todas las páginas de una manera muy rápida.
libpagina.phtml
<?php echo "<!--847772560519813174-->"; ?>
<?php echo "<!--961635409800957932-->"; ?>
<!-- Manual de PHP de WebEstilo.com -->
<?php
function CabeceraPagina()
{
?> <FONT SIZE="+1">Esta cabecera estará en todas sus páginas.</FONT><BR>
<hr>
<? }
function PiePagina()
{
?> <hr>
<FONT SIZE="-1">Este es el pie de página.</FONT><BR>
Autor: Joaquin Gracia
<? }
function Indice()
{
?> <A HREF="ejem06a.phtml">Pagina 1</A><BR>
<A HREF="ejem06a2.phtml">Pagina 2</A><BR>
<? } ?>
ejem06a.phtml
<?php echo "<!--131107337420335434-->"; ?>
<?php echo "<!--158550853529910713-->"; ?>
<!-- Manual de PHP de WebEstilo.com -->
<html>
<head>
<title>Ejemplo de PHP</title>
</head>
<body>
<?php include("libpagina.phtml") ?>
<?php CabeceraPagina(); ?>
<TABLE>
<TR>
<TD><?php Indice() ?></TD>
<TD>
Esta es otra página<BR><BR>
completamente distinta<BR><BR>
pero comparte el pie y la cabecera con la otra.<BR><BR>
</TD>
</TR>
</TABLE>
<?php PiePagina(); ?>
</body>
</html>
ejem06a2.phtml
<?php echo "<!--685631574351327495-->"; ?>
<?php echo "<!--65546247771864704-->"; ?>
<!-- Manual de PHP de WebEstilo.com -->
<html>
<head>
<title>Ejemplo de PHP</title>
</head>
<body>
<?php include("libpagina.phtml") ?>
<?php CabeceraPagina(); ?>
<TABLE>
<TR>
<TD><?php Indice() ?></TD>
<TD>
Página 1
<BR><BR><BR><BR><BR>
Contenido blalbl blalb alb<BR><BR>
más cosas...<BR><BR>
fin<BR><BR>
</TD>
</TR>
</TABLE>
<?php PiePagina(); ?>
</body>
</html>