WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

Scripte und Programme für PHP, MYSQL. Diskussionen zur Programmierung im Web. Fragen zu CMS, Blogsoftware, Shops, Newsletter und vielen weiteren Scripten.


Forum » PHP & MySQL » Smarty & PHP5 » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von aykut
Hi,

mein smarty Konfiguration läuft 99%, für 1% bräuchte ich eure Hilfe!

zZ benutze ich folgende Verzeichnisse, auf die werde ich in meinen Fragen eingehen.

root/
projectX/
+---smarty
¦ +---cache
¦ +---compiles
¦ +---configs
¦ +---libs
¦ ¦ +---internals
¦ ¦ +---plugins
¦ +---templates


/root/projectX/smarty/smarty_connect.php
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24:
<?php
require('libs/Smarty.class.php');

class smarty_connect extends Smarty 
{
   function smarty_connect()
   {
		$fixpath = dirname(__FILE__);
		$fixpath = str_replace("\\","/",$fixpath);
   		  		
		$this->Smarty();

		$this->template_dir = $fixpath."/templates";		
		$this->config_dir = $fixpath."/configs";
		$this->compile_dir = $fixpath."/compiles";
		$this->cache_dir = $fixpath."/cache";

		$this->assign('app_name', 'Intranet');
		
		$this->caching = true;
   }
}
?>


/root/projectX/index.php
1: 
2: 
3: 
4: 
5: 
6: 
7:
<?
require_once('smarty/smarty_connect.php');

$smarty = new smarty_connect;
$smarty->display('index.tpl');

?> 


wichtig: die aufgerufene tpl Datei ist in dem selben Verzeichnis wie der Aufrufer php Datei
/root/projectX/index.tpl
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10:
   <html>
      <head>
         <title>Beschreibung der Seite</title>
      </head>
      <body>
            TEST
      </body>
   </html>


Ich bekomme folgende Meldung:
1: 
2:
Warning: Smarty error: unable to read resource: "index.tpl" in 
C:\Programme\Apache Group\Apache2\htdocs\friseur\smarty\libs\Smarty.class.php on line 1095


Wenn ich in dem index.php den Pfad von index.tpl nach ../../index.tpl ändere dann läufts!
/root/projectX/index.php
1: 
2: 
3: 
4: 
5: 
6:
<?
..
$smarty->display('../../index.tpl');

..
?> 


Mein Problem: php und tpl sind jeweils in dem selben Verzeichnis, (so will ichs haben).

Bsp:

root\index.php
root\index.tpl
Zugriff von php via $smarty->display('index.tpl');

or

root\subdir\display.php
root\subdir\display.tpl
Zugriff von php via $smarty->display('display.tpl');


Wie kann ich das Problem lösen?

danke Aykut


Nach oben