|
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 |
tiberian Smarty Rookie
Joined: 19 Aug 2003 Posts: 5 Location: Germany, Wadersloh
|
Posted: Fri Jan 07, 2005 11:39 am Post subject: aktualisierung von templates aus Mysql |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Jan 07, 2005 12:46 pm Post subject: |
|
|
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 |
|
|
|
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
|