[thelist] php include

Aleem Bawany aleem.bawany at utoronto.ca
Wed Jan 22 22:21:00 CST 2003


> Would like to hear if anyone has the same thing but has
> made any additional improvements upon it!

The design calls the content in your code, meaning if you
have to change the design, you still have to edit all
the files. Am I right? You could use PHP smarty templating
engine (takes < a day to learn and implement) or try something
like this:
----------- index.php -----------
include('template.inc');
$title = "title";
$extraStyle = "style_for_this_page.css";

$header = "header";
$body=<<<EOT;
<h1> $header </h1>
<p> ... </p>
EOT;

renderpage();

----------- template.inc -----------
<?php
function renderpage() {
  global $title, $extraStyle, $body
?>
  <html><head><title>$title</title>
  ...
  @import "style.css";
  @import "<?php $extraStyle.css ?>";
  ...
  </body></html>
<?php
}
?>

someone on the list offered that advice, before
which I used the same approach as you mentioned.

aleem

[ http://members.evolt.org/aleem/ ]




More information about the thelist mailing list