|
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 |
superceu Smarty n00b
Joined: 28 Jul 2005 Posts: 1
|
Posted: Thu Jul 28, 2005 6:03 pm Post subject: $smarty->clear_compiled_tpl("customresource:name&quo |
|
|
I would like to clear the compiled version of a user defined resource without knowing all the compile_ids.
$smarty->clear_compiled_tpl("catmenu:header") doesn't work
$smarty->clear_compiled_tpl("catmenu:header", "compile_id") works, but I don't want to use all the compile_id (because it's difficult to know all the possible combinations)
"catmenu" is a custom resource (it's not a regular template file).
I have a menu class that retrieves menu items from database and build a javascript menu. I'm using smarty to compile a different menu for every group of users (regular users don't see all the menu items reserved to admins, etc etc).
Sometimes (rarely) the menu changes, and I need to remove the old compiled versions. Now I'm using $smarty->clear_compiled_tpl(), but this deletes all the compiled templates.
PS: I can't use caching and cache_id for this purpose, I need compile_id.
Thank you! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jul 28, 2005 6:11 pm Post subject: |
|
|
you can
a) save the modification time of your menu's changes and use compile_check to make smarty detect it has to recompile your templates.
or
b) call clear_compiled_tpl() with all possible compile-ids
there is not way to clear a template or ressource for all compile_ids at once. |
|
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
|