PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : smarty pfadvergabe...


dirter
21.10.2005, 19:50:19
hallo,


ich schreibe grade an meinem ersten größeren projekt und nutze dort smarty als templatesystem.
Ich beschreib mal etwas den aufbau. Also documentRoot ist /stufenhp/ in diesem Verzeichniss hab ich die Verzeichnisse
/stufenhp/

smarty/


templates/


templates_c/


configs/


module/


style/



In dem Ordner module liegen meine Scripte, darin liegt:

/stufenhp/
smarty/
templates/
templates_c/
configs/
module/

News/


Navigation/


Login/


Register/


style/

In dem Ordner Navigation hab ich die Datei NavigationFunktionen.php und die datei Primnavi.tpl.
Wie muss ich die pfade in der NavigationFunktionen.php nun anpassen, dass mein smarty läuft, ich poste mal den quelltext der beiden dateien.
Code:

NavigationFunktionen.php
function load_primary_navi() {
include('../../smarty/Smarty.class.php');
$server = mysql_connect("localhost", "root", "");
mysql_select_db("stufenhp");
$sql = "SELECT url, name FROM navi_tabelle WHERE parentid = 0";
if(!$result = mysql_query($sql, $server)) {
writelog(mysql_error($server), mysql_errno($server));
echo "Fehler";
return false;
}
else {
$output = new Smarty;
$output->compile_dir = '../../templates_c';
$output->template_dir = 'module/Navigation/';
$output->config_dir = '../../configs/';
$menu = array();
while($row = mysql_fetch_assoc($result)) {
$menu[] = $row;
}
$output->assign('menupunkte', $menu);
$output->display('Primnavi.tpl');
return true;
}
}


Primnavi.tpl

<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../style/style.css">
</head>

<body>
<div id="title">test</div>
<div id="left">
{foreach from=$menupunkte item=menupunkt}
<p><a href={menupunkt.url}>{menupunkt.name}</a></p>
{/foreach}
</div>
<div id="content">test</div>

</body>
</html>



Ich hoffe ihr könnt mir helfen und versteht was cih meine

bisher bekomme ich den error Cant read resource Primnavi.tpl in... on line 1088.

viele grüße und danke