Super, nekaj takega sem iskal. Malo sem probaval kako in kaj s tem in se mi je zalomilo. Torej imam datoteke: main.tpl, header.tpl, user.tpl, footer.tpl.
main.tpl
<head>
<title>{site_title}</title>
</head>
<body>
{include header.tpl}
<div id="content">{site_content}</div>
{include header.tpl}
</body>
</html>
v header.tpl in footer.tpl imam nek tekst
user.tpl
<h1>{username} profile</h1>
<ul>
<li><span>Name:</span>{name}</li>
<li><span>Age:</span>{age}</li>
<li><span>Location:</span>{location}</li>
<li><span>Date:</span>{date}</li>
</ul>
<ul>
{foreach $users as $id=>$user}
<li><a href="{id|escape}">{user}</a></li>
{/foreach}
</ul>
in datoteka user.php
<?php
include('class.minitpl.php');
$tpl = new minitpl;
$tpl->load('user.tpl');
$data = array(
"username" => "test",
"name" => "Kwak",
"age" => "150",
"location" => "Slovenija",
"date" => date("m.d.Y")
);
$tpl->assign($data);
$users = array(
"users" => array("test1", "test2", "test3", "test4", "test5"),
);
$tpl->assign($users);
$tpl->render();
?>
Zdaj bi pa jas želel, da je main.tpl glavn fajl in je kot neke vrste iztočnica za druge datoteke. Torej če jas v brskalniku odprem user.php bi mi preko main.tpl moralo naložit header in footer ter vsebino user.tpl. Torej zanima me kako spremenljivko $tpl "vpisati" pod site_content v main.tpl. Upam da razumete. :)