RE: [SMARTY] question about the dynamic %% directory in C:\
| From: | Hoffman, Geoffrey | Date: | Wed, 08 Jan 2003 22:23:28 +0000 |
| Subject: | RE: [SMARTY] question about the dynamic %% directory in C:\ | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-7066@lists.php.net to get a copy of this message | ||
You guys and this list rock.
A Thousand Thanks.
PQG> $_GET['sec'] . "&" . $_GET['sty'] instead
I probably will have a section 14 due to they're being added on the fly by
the CMS editors! You nailed that one.
MO> $smarty->display('index.tpl','1');
MO> $smarty->display('foobar.tpl','1');
MO> will still create separate caches.
This is very helpful info also. I'm going to have to go back and read your
previous posts about 'granularity' and different caching schemes a few weeks
back.
Incedently I found the 'advanced' installation of smarty shown on the docs,
by extending the smarty class to be very helpful, so now my app has its own
cache not in C:\ anymore. Also I think that might be a pretty obvious place
to hang additional functionality off the $Smarty variable. Such a well
conceived system, it's so great when the lightbulbs start going off... and I
know I have barely scratched the surface.
Geoff
> -----Original Message-----
> From: Patrick Quinn-Graham [mailto:me@pftqg.com]
> Sent: Wednesday, January 08, 2003 2:23 PM
> To: Hoffman, Geoffrey
> Subject: RE: [SMARTY] question about the dynamic %% directory in C:\
>
>
> The only problem with the cacheid being sec . sty is that if
> you have a
> section 14, you'll run in to problems. It's probably just as
> easy to do
> $_GET['sec'] . "&" . $_GET['sty'] instead (that way
> it'll end up being
> 1&4, and you're almost guranteed never to get a section with
> that number
> :-)).
>
> P.
>
> -----Original Message-----
> From: Hoffman, Geoffrey [mailto:ghoffman@aztrib.com]
> Sent: Thursday, 9 January 2003 10:03 a.m.
> To: Smarty (E-mail)
> Subject: RE: [SMARTY] question about the dynamic %% directory in C:\
>
> Thanks to Nichlas and Monte, my cache now works perfectly with one get
> param.
>
> Next question is, the user is going to view a section page
> (index.php?sec=1,
> sec=2, etc) which generates a summary of news items. they
> click on 'read
> more' for a story summary and get a link like index.php?sec=1sty=4.
> should I
> just call that cache_id 14, meaning, do ->display('index.tpl',
> $_GET['sec'].$_GET['sty']) ? in theory that will cache both
> the summary
> page
> for a section, and the story detail pages?
> I supposed I could use a new (mostly copied) detail.php/detail.tpl and
> cache_id $_GET['sty'] - what do you think?
>
> Thanks again-
> Geoff
>
> > -----Original Message-----
> > From: Nichlas Löfdahl [mailto:crotalus@acc.umu.se]
> > Sent: Wednesday, January 08, 2003 12:07 PM
> > To: Hoffman, Geoffrey; Smarty (E-mail)
> > Subject: Re: [SMARTY] question about the dynamic %% directory in C:\
> >
> >
> > Hello!
> >
> > Try something like this:
> >
> > $smarty->display('yourtemplate.ihtml', $_GET['sec']);
> >
> > (but you should probably check $_GET['sec'] for proper values etc.).
> >
> > Read more about caching here:
> > http://smarty.php.net/manual/en/caching.php
> > http://smarty.php.net/manual/en/api.display.php
> >
> > /Nichlas
> > ----- Original Message -----
> > From: "Hoffman, Geoffrey" <ghoffman@aztrib.com>
> > To: "Smarty (E-mail)" <smarty-general@lists.php.net>
> > Sent: Wednesday, January 08, 2003 7:58 PM
> > Subject: [SMARTY] question about the dynamic %% directory in C:\
> >
> >
> > > I have started putting some dynamic SQL stuff into
> > index.php in my first
> > > Smarty project. I have news stories in different sections, i want
> > > index.php?sec=1 to be 'news' stories, ?sec=2 to be sports
> > stories, etc.
> > >
> > > What I have so far will work (e.g. the stories show up
> > under the given
> > > section) but only if I trash the cache folder _after each
> > get_ . In other
> > > words, my get param is only recognized if there's no cache;
> > once the cache
> > > is created (for sec=2 or sports stories) all subsequent
> requests of
> > > index.php?get=anything gives me sports stories. If I trash the %%
> > directory
> > > in C:\ then I can do sec=1 and get main section stories,
> > but then it's
> > > 'frozen' in main section.
> > >
> > > i want to take advantage of caching where possible, but
> > what code (and
> > > where) should i use to refresh using the value ($_GET) passed to
> > index.php?
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>