I think at this stage you want to use the php's HERE DOC feature. Ruby supports it too but PHP can run on just about webserver. Here is a generic version I used doing php sites.
Code:
<?php
class pageLayout {
var $_year;
var $sid;
var $title;
var $client;
var $content;
var $page;
function pageLayout($sid, $title, $client, $content) {
$this->title = $title;
$this->sid = $sid;
$this->client = $client;
$this->content = $content;
$this->addHeader();
$this->_year = date("Y");
}
function addHeader() {
$this->page .= <<<EOL
<html>
<head>
<title>$this->title</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
EOL;
}
function addContent() {
$this->page .= $this->content;
}
function addFooter() {
$this->page .= <<<EOF
<div align="center">© $this->_year $this->client</div>
</body>
</html>
EOF;
}
function getPage() {
$temp = $this->page;
$this->addFooter();
$page = $this->page;
return $page;
}
?>
Bookmarks