|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
dragon001 Smarty Rookie
Joined: 12 Feb 2005 Posts: 5
|
Posted: Sun Feb 13, 2005 12:01 am Post subject: Problem mit SMARTY und Funktionen |
|
|
Ich erhalte folgende Fehlermeldung im Browser:
Fatal error: Call to a member function on a non-object in /xxxxxxxxxxxxxx/template/tple.php on line 44
Smarty wird folgender Maßen initialiesiert:
$smarty = new Smarty;
$smarty->template_dir = system_server_directory.$dok["path"].'/tpl/';
$smarty->compile_dir = system_server_directory.$dok["path"].'/tpl_c/';
$smarty->config_dir = system_server_directory.$dok["path"].'/cfg/';
$smarty->cache_dir = system_server_directory.$dok["path"].'/cache/';
$smarty->left_delimiter = $dok["delimleft"];
$smarty->right_delimiter = $dok["delimright"];
$smarty->caching = $dok["cache_active"];
$smarty->cache_lifetime = $dok["cache_livecycle"];
$smarty->compile_check = $dok["compile_check"];
$dok["xxxx"] wird aus der template Definition geladen. Die Datei ist aber aufgerufen und aktive (hab ich geprüft)
Hier nun der Code der Fehler publiziert:
function header() {
global $user, $sitename, $slogan, $cookie, $prefix, $db, $dok, $smarty;
cookiedecode($user);
$username = $cookie[1];
if ($username == "") {
$username = "Anonymous";
}
$smarty->assign('username',$username);
echo "<body bgcolor=\"".$dok["bgcolor"]."\" text=\"".$dok["textcolor"]."\" link=\"".$dok["linkcolor"]."\" vlink=\"".$dok["vlinkcolor"]."\" alink=\"".$dok["alinkcolor"]."\"";
echo "BACKGROUND=".$dok["gbimage"];
echo $dok["advanced_head"].">";
echo "<!-- Template Javascripts -->";
echo $dok["user_javascript"];
ich versteh es nicht.
$db ist auch ein Object(mein Datenbank layer.
(beispielsweise: $db->query functioniert (ist eine der Funktionen des Layers)).
Hof ihr könnt mir helfen.
Smarty an sich ist total genial
MFG
dragon001 |
|
Back to top |
|
dan_zm Smarty Rookie
Joined: 25 Feb 2005 Posts: 6 Location: Zella-Mehlis, Germany
|
Posted: Sat Feb 26, 2005 12:43 pm Post subject: |
|
|
hi,
also
Quote: | Fatal error: Call to a member function on a non-object in /xxxxxxxxxxxxxx/template/tple.php on line 44 |
heisst ja, dass er $smarty noch nich "kennt" zu dem zeitpunkt, wo du die funktion aufrufst. du müsstest vielleicht mal dein komplettes script posten, da sieht man besser woran es liegen könnte. _________________ The following sentence is a lie. The preceding sentence is true. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|