 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
Jemshope Smarty n00b
Joined: 12 Jan 2012 Posts: 1
|
Posted: Fri Jan 13, 2012 3:20 am Post subject: I have some caching problem to sort out |
|
|
| I have some caching problem to sort out. When I use one variable 'view', it is working fine but when I want to use two variables 'view' and 'id' then i make no sense and wont work for mee. So - is it possible to cache the page as an unique page and use more then one variable? How to? |
|
| Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 524
|
Posted: Fri Jan 13, 2012 11:50 am Post subject: Re: I have some caching problem to sort out |
|
|
| Jemshope wrote: | | I have some caching problem to sort out. When I use one variable 'view', it is working fine but when I want to use two variables 'view' and 'id' then i make no sense and wont work for mee. So - is it possible to cache the page as an unique page and use more then one variable? How to? |
do you mean like:
$cache_id = $view.','.$id |
|
| Back to top |
|
rodneyrehm Administrator

Joined: 30 Mar 2007 Posts: 698 Location: Germany, border to Switzerland
|
Posted: Fri Jan 13, 2012 12:50 pm Post subject: Re: I have some caching problem to sort out |
|
|
| douglassdavis wrote: | | $cache_id = $view.','.$id |
If your cache_id forms a hierarchy (much like a directory structure) you should delimit the components with a | (pipe). Only then is smarty able to also kill the cache of "view|123" when you clearCache(null, "view") _________________ Twitter |
|
| Back to top |
|
dough boy Smarty Rookie
Joined: 31 Mar 2006 Posts: 32
|
Posted: Sat Mar 10, 2012 9:27 pm Post subject: |
|
|
Sorry to step on this topic, but are you saying if I did something like:
| Code: |
$cache_id = 'a|b|1';
$cache_id = 'a|b|2';
$cache_id = 'a|b|n';
$smarty->clearCache(null, 'a|b|1'); # resets only 'a|b|1'
$smarty->clearCache(null, 'a|b'); # resets all under 'a|b' (1, 2, n)
$smarty->clearCache(null, 'a'); # resets all under 'a' (b1, b2, bn)
|
|
|
| Back to top |
|
rodneyrehm Administrator

Joined: 30 Mar 2007 Posts: 698 Location: Germany, border to Switzerland
|
Posted: Sat Mar 10, 2012 9:28 pm Post subject: |
|
|
| dough boy wrote: | | Sorry to step on this topic, but are you saying if I did something like: … |
that is the general idea, yes. _________________ Twitter |
|
| 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
|