Mailinglisten-Archive |
Hi NG
Ich hab ein Problem, ich versuche jetzt schon seit gestern einen
Platzhalter {content} in einer Template mit einer anderen Template
(catmain.html) zu ersetzen.
Meine Templates sehen so aus:
---main.html---
<html>
<head>
<title>{title}</title>
</head>
<body>
{content}
</body>
</html>
---catmain.html---
<h1>{title}</h1>
<p>{catlisting}</p>
<p>{linklisting}</p>
Mein Script sieht so aus:
require_once("../../config.inc");
// $incDir wird in config.inc gesetzt...
require_once($incDir."ITX.php");
// load template class
$tpl = new IntegratedTemplateExtension($tplPath);
// load template file
$tpl->loadTemplateFile("main.html", false, false);
// set the placeholder {content} in main.html to the file catmain.html
(handler: catmain)
$tpl->addBlock("content", "catmain", "catmain.html");
// these 2 vars are going to be other templates later on... :o)
$tpl->setVariable("catlisting", "catlisting");
$tpl->setVariable("linklisting", "linklisting");
// fill in the blanks
$tpl->setVariable("title", $catName);
// parse the whole page
$tpl->show()
------------
Wenn ich erstmal die 2te template eingebunden hab will ich die
platzhalter {catlisting} und {linklisting} spaeter auch noch mit
weiteren templates ersetzen. Falls ihr wisst wie das geht sagts mir auch
gleich... :o)
Aber erstmal will ich {content} durch catmain.html ersetzen!
danke schon mal fuer eure hoffentlich zahlreichen antworten. :o)
mfg, Hendrik
php::bar PHP Wiki - Listenarchive