Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

I can't find the function setCaching() anywhere in my Smarty

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
pedrotester
Smarty Rookie


Joined: 06 Jun 2019
Posts: 22

PostPosted: Fri Aug 16, 2019 9:33 pm    Post subject: I can't find the function setCaching() anywhere in my Smarty Reply with quote

Hello,

I have enabled caching with setCaching and it works fine but when I check in my files, I can't find anything related to that method/function (with grep). I'm a beginner in PHP so I really don't understand why/how.

Maybe the function name is dynamically formed?

Can someone enlighten me?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1572

PostPosted: Wed Aug 21, 2019 8:21 am    Post subject: Reply with quote

What name/function you are referring to?
Back to top
View user's profile Send private message
pedrotester
Smarty Rookie


Joined: 06 Jun 2019
Posts: 22

PostPosted: Wed Aug 21, 2019 5:52 pm    Post subject: Reply with quote

Quote:
$smarty->setCaching(Smarty::CACHING_LIFETIME_CURRENT);


As written here: https://www.smarty.net/docs/en/caching.tpl


I can find "caching" but not "setCaching" however both enable caching, so i'm just confused
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1572

PostPosted: Thu Aug 22, 2019 4:58 am    Post subject: Reply with quote

Use setCaching()

And yes, these are dynamically inserted.
Back to top
View user's profile Send private message
pedrotester
Smarty Rookie


Joined: 06 Jun 2019
Posts: 22

PostPosted: Sat Sep 21, 2019 9:01 pm    Post subject: Reply with quote

(i had no internet for a while and forgot this)

So you mean that "setCaching" is not present in the files, because the word "setCaching" is dynamically created?

Because I don't find the word "setCaching" at all in my files, yet it works. (Sorry to repeat but I want to be sure)
Back to top
View user's profile Send private message
bsmither
Smarty Pro


Joined: 20 Dec 2011
Posts: 245
Location: West Coast

PostPosted: Sat Sep 21, 2019 11:07 pm    Post subject: Reply with quote

In Smarty 3.1.33, in the file /sysplugins/smarty_internal_templatebase.php, at line 358, I found setCaching($caching).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP