Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem mit SMARTY und Funktionen

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
dragon001
Smarty Rookie


Joined: 12 Feb 2005
Posts: 5

PostPosted: Sun Feb 13, 2005 12:01 am    Post subject: Problem mit SMARTY und Funktionen Reply with quote

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 Wink

MFG
dragon001
Back to top
View user's profile Send private message
dan_zm
Smarty Rookie


Joined: 25 Feb 2005
Posts: 6
Location: Zella-Mehlis, Germany

PostPosted: Sat Feb 26, 2005 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP