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

Search found 13 matches
Smarty Forum Index
Author Message
  Topic: include template with cache_lifetime expire at midnight
wern0561

Replies: 4
Views: 4693

PostForum: General   Posted: Thu Jan 03, 2019 10:19 pm   Subject: include template with cache_lifetime expire at midnight
Here you make a mistake.
All the following is a product of it.

Thanks for the reply.

I suppose you are correct. I guess this isn't the way Smarty is intended to be used. I thought this was som ...
  Topic: include template with cache_lifetime expire at midnight
wern0561

Replies: 4
Views: 4693

PostForum: General   Posted: Fri Dec 28, 2018 9:30 pm   Subject: include template with cache_lifetime expire at midnight
After spending way too much time digging through the source code, I don't think there is any good way to do what I want. At least not that I am aware of.

Here are my observations.

When setting ...
  Topic: include template with cache_lifetime expire at midnight
wern0561

Replies: 4
Views: 4693

PostForum: General   Posted: Wed Dec 26, 2018 11:13 pm   Subject: include template with cache_lifetime expire at midnight
Hello,

In my project I have a root template file that contains a lot of dynamic content that I don't want cached and so, by default, I turn caching off. I have this root template including other te ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Tue Sep 10, 2013 9:25 pm   Subject: Nested includes with caching and assigned vars
You are correct. I am updating some old code to smarty 3 and I forgot to rename cache to cache_lifetime. That was sloppy on my part. Thanks.
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Tue Sep 10, 2013 8:49 pm   Subject: Nested includes with caching and assigned vars
No, this still does not work. Its assigning the variable as an integer now but its still being interpreted as a string, I think.

The resulting cached content page:

...
<?php $_smarty_tpl-> ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Tue Sep 10, 2013 8:29 pm   Subject: Nested includes with caching and assigned vars
So after looking at this a little closer I have found one issue but its a simple fix. The cache_lifetime expects an integer and the block function you initially provided is writing every variable as a ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Tue Sep 10, 2013 5:38 pm   Subject: Nested includes with caching and assigned vars
U.Tews. I just tried the code you provided and it seems to be working perfectly. I inspected the cached files and everything seems to be correct. I'll continue reviewing it. If I find anything I'll po ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Tue Sep 10, 2013 5:09 pm   Subject: Nested includes with caching and assigned vars
Hi U.Tews. Thank you so much for your thorough and quick response. I will give that a try and see if it works.

I'm glad to hear this might find its way into a release in the future. I generally tr ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Mon Sep 09, 2013 11:32 pm   Subject: Nested includes with caching and assigned vars
Thanks for the suggestion. Yes. I can do that but it kind of defeats the purpose of caching the output of that template to begin with.

The obj being assigned does a database lookup and some php log ...
  Topic: Nested includes with caching and assigned vars
wern0561

Replies: 10
Views: 10585

PostForum: General   Posted: Mon Sep 09, 2013 9:50 pm   Subject: Nested includes with caching and assigned vars
SYNOPSIS
Basically, what I am looking for is a way to assign variables within a template that get saved and reused in the cached version so that I can use the cached variables to include other files. ...
  Topic: Smarty caching
wern0561

Replies: 10
Views: 19039

PostForum: Plugins   Posted: Mon Feb 28, 2011 10:42 pm   Subject: Smarty caching
If you are using mysql as your database you should look into the mysql query cache. http://dev.mysql.com/doc/refman/5.1/en/query-cache.html Basically when you run a query it saves the result of that e ...
  Topic: Display part of a template in a given time range
wern0561

Replies: 0
Views: 6062

PostForum: Plugins   Posted: Wed Feb 23, 2011 10:17 pm   Subject: Display part of a template in a given time range
Sometimes I find the need to display some content on a page only during a very specific time frame. Usually something like this is handled at the application level not the presentation level but its n ...
  Topic: How to cache included templates
wern0561

Replies: 2
Views: 8021

PostForum: Smarty Development   Posted: Mon Jan 05, 2009 11:25 pm   Subject: How to cache included templates
I though I would share how I've been using smarty so it can be considered for inclusion.

I'm currently building a site that will contain lots of user specific elements on each page and i needed a ...
 
Page 1 of 1
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP