Posted: Wed Sep 07, 2005 4:12 am
My pereferred method.... using Heredoc:
Basically all the HTML looks and feels like HTML to everyone excluding the dynamic bits that can't really be fiddled with to any great extent. Everything dynamic is pre-computed and just added to the template as it's produced.
Heredoc is very clean and nice for others to edit without getting too mixed up in PHP code and it saves on all that Regex stuff... just my pereference
Code: Select all
<?php
$Template->GetHTTPHeaders();
$HTML = <<<HTMLEND
<!DOCTYPE blah blah....
// >
<html>
<head>
<title>{$Template->GetTitle()}</title>
<style type="text/css">
@import "your_standard_css_stff.css"
{$Template->GetCSSExtra()}
</style>
<script type="text/javascript">
<!-- Hide
some_js_functions()
{
//
}
{$Template->GetExtraJS()}
//End -->
</script>
</head>
<body{$Template->GetOnLoad()}>
<div id="page_container">
<div id="whetever">
Whatever other standard stuff is in your template
</div>
{$Template->GetBody()}
</div>
{$Template->GetFooter()}
</body>
</html>
HTMLEND;
echo $HTML; //Print back to browser
?>Heredoc is very clean and nice for others to edit without getting too mixed up in PHP code and it saves on all that Regex stuff... just my pereference