prc wrote:can you give me any more info on what launguage this is?
and were I can find out more about it?
it's not really a "language" by definition since you can use any delimeters or tags you wish as you create a template. basically, it's simply a way for you to pull all your markup out of your PHP and replace those {tags} with content generated by PHP in your document. for instance:
this may be my template file saved as "basic.tpl" or such:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{TITLE}</title>
<link type='text/css' rel='stylesheet' href='{PATH}/styles.css' />
</head>
<body>
<h1>{MAIN_HEADER}</h1>
<p>{PARAGRAPH_CONTENT}</p>
</body>
</html>
then, i'd do something like this for my index.php:
<?php
$title = "My Test Template";
$path = "."; // each page would define their path to root so that styles are included correctly
$header = "Testing \"Basic\" Template";
$content = "This is my paragraph content. It could be generated in any way at all.";
// get the contents of our template for output
$output = file_get_contents("basic.tpl");
// set the values of the tags for our template
$replace = array(
"TITLE" => $title,
"PATH" => $path,
"MAIN_HEADER" => $header,
"PARAGRAPH_CONTENT" => $content
);
// create separate arrays for tags and replacements so as to only call str_replace() once
$tags = array();
$filler = array();
foreach ($replace as $key => $val) {
$tags[] = '{' . $key . '}';
$filler[] = $val;
}
// replace the tags with appropriate content
$output = str_replace($tags, $filler, $output);
// print out the modified page:
echo $output;
?>
this is an extremely simplified example, but i hope it gives you the basic idea of what the tags and templates allow for.