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

aktualisierung von templates aus Mysql

 
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
tiberian
Smarty Rookie


Joined: 19 Aug 2003
Posts: 5
Location: Germany, Wadersloh

PostPosted: Fri Jan 07, 2005 11:39 am    Post subject: aktualisierung von templates aus Mysql Reply with quote

Hallo zusammen!
Ich hab ein Problem mit der Smarty-Engine. Ich lade über ein resource PLugin ein template aus einer mysql datenbank. Funktioniert auch soweit, allerdings wird die änderung nicht übernommen. Das bedeutet, wenn ich das Template in der mysql ändere und dann ausgebe, wird nicht die neue Version aus der db genommen sondern die geparste aus der /templates_c Ich muss immer erst den ordner /templates_c leeren, damit sich die Änderungen bemerkbar machen.

Gibt es da einen Workaround? Oder mache ich was falsch?
Danke für Hinweise
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jan 07, 2005 12:46 pm    Post subject: Reply with quote

wenn du $smarty->compile_check an hast und in der timestamp-funktion deines resource-plugins das korrekte (aktualisierte) modifikationsdatum deines templates liefert, dann sollte das template automatisch neu kompiliert werden.

wenn du aus performancegründen $smarty->compile_check aus hast, dann hilft nichts, auser das kompilierte template zu löschen.

evtl. kannst du das aber automatisieren, wenn du beim update des templates in der datenbank ein clear_compiled_tpl() machst.

[php:1:3dfd87bc0e]
foreach($allemoeglichen_compile_ids as $compile_id) {
$smarty->clear_compiled_tpl($template, $compile_id);
}
[/php:1:3dfd87bc0e]

wenn du keine compile_ids verwendest, dann reicht:
[php:1:3dfd87bc0e]
$smarty->clear_compiled_tpl($template);
[/php:1:3dfd87bc0e]

HTH
messju
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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