Ja, ganz egal, ob ich den Smarty Befehl in die daten.php-Datei schreibe (plus Inhalte für das Template) oder den Smarty Befehl direkt in die index.php-Datei (daten.php besitzt dann nur die Inhalte fürs Template) - es wird immer nur der erste include Befehl ausgeführt und nur ein Template erscheint.
Nur wenn ich den include Befehl weglasse und alle Samrty Befehle in die index.php direkt schreibe, werden alle Templates angezeigt.
Bin total ratlos...
Hier mal alle Varianten, die ich durchprobiert habe:
Variante 1:
index.php
PHP-Code:
<?php
include ("test1.php");
include ("test2.php");
?>
test1.php / test2.php:
PHP-Code:
<?php
error_reporting(E_ALL);
define('SMARTY_DIR', 'Smarty/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('name', '111');
$smarty->display('index1.tpl');
?>
---------------------------------------------------
Variante 2:
index.php:
PHP-Code:
<?php
error_reporting(E_ALL);
define('SMARTY_DIR', 'Smarty/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
include ("test1.php");
include ("test2.php");
?>
test1.php / test2.php:
PHP-Code:
$smarty->assign('name', '111');
$smarty->display('index1.tpl');
---------------------------------------------------
Variante 3:
index.php
PHP-Code:
<?php include ("test1.php"); ?>
<?php include ("test2.php"); ?>
test1.php / test2.php:
PHP-Code:
<?php
error_reporting(E_ALL);
define('SMARTY_DIR', 'Smarty/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('name', '111');
$smarty->display('index1.tpl');
?>
---------------------------------------------------
NICHTS FUNKTIONIERT - es wird immer nur das erste Template angezeigt (test1.php) - test2.php fehlt - beide sollen in die index.tpl Datei eingefügt werden.