Veröffentlicht 8. März 200619 j Irgendwie bin ich glaub ich grad nen bisschen doof. Ich hab folgende Verzeichnisstruktur: /testserver (Server-Root) - main -- includes --- pageHeader.php --- pageFooter.php -- index.php - lib -- smarty --- libs ---- Smarty.class.php - templates -- page-layout.tpl - templates_c pageHeader.php: ... $rootPath = realpath('../'); define('TEMPLATES_PATH', $rootPath . '/lib/templates/'); define('TEMPLATES_C_PATH', $rootPath . '/lib/templates_c/'); $smarty = new Smarty(); ... pageFooter.php: ... $smarty->display('page-layout.tpl'); ... Prinzipiell ist der Pfad der template datei nun /testserver/lib/templates/page-layout.tpl smarty sollte suchen in: /testserver/lib/templates/ Ich bekomme aber nun trotzdem beim aufruf von index.php den folgenden fehler: Warning: Smarty error: unable to read resource: "page-layout.tpl" in /srv/www/webnauts_net/testserver/lib/smarty/libs/Smarty.class.php on line 1095 Bin euch für jede Idee dankbar... ich find einfach das Prob nicht ... mfg Eth
8. März 200619 j Hi, du musst Smarty auch deine Constanten mitteilen.. $smarty->template_dir = '/web/www.example.com/smarty/guestbook/templates/'; $smarty->compile_dir = '/web/www.example.com/smarty/guestbook/templates_c/'; $smarty->config_dir = '/web/www.example.com/smarty/guestbook/configs/'; $smarty->cache_dir = '/web/www.example.com/smarty/guestbook/cache/'; Gruß, Markus http://smarty.php.net/manual/en/installing.smarty.basic.php
8. März 200619 j mach ich doch: define('TEMPLATES_PATH', $rootPath . '/lib/templates/'); define('TEMPLATES_C_PATH', $rootPath . '/lib/templates_c/');
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.