jest jeszcze cos jestem w trakcie rozkminiania systemu szablonów ...
//TO JEST TAKI SUB TEMPLATE
<div style="background-color:#EEDEAE; width:100px; height:100px;"> {OBRAZEK[numerek]}
</div> <div style="font-wieght:bolder;">{NAZWA[numerek]}
</div>
//A TO TAKI GŁÓWNY
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <div style="background-color:black; color:white; width=100%;"> TU BEDZIE TOP
</div>
<div>MENU | MENU | MENU | MENU |
</div>
<div style="background:#E0A033;">{PRODUCT}
</div>
TUTAJ JEST TEN SYSTEM SZABLONÓW
<?php
class view
{
private $toChange;
private $str;
private $pathTemp;
public function __construct()
{
$this -> toChange = array(); $this -> str = '';
$this->pathTemp='template';
}
public function setTemplate($ATemplate)
{
$this -> str = $ATemplate;
}
public function loadFromFile($FileName='def')
{
}
public function addChange($AKey, $AValue)
{
$this -> toChange[$AKey] = $AValue;
}
public function assign()
{
}
public function executeChanges()
{
if (count($this -> toChange) > 0
) {
foreach ($tmpKeys as $currentKey) {
$this -> toChange[$currentKey],
$this -> str);
}
}
return $this -> str;
}
}
?>
teraz chodzi mi o pewien sposób wstrzykniecia np kilka razy tego sub template do {PRODUCT}
jak to zrobic?? oczywiscie zeby to mialo rece i nogi bo mi tylko przychodzi petala do petli petla porkryta wiec nie fajnie