AhmadAssaf
AhmadAssaf

Reputation: 3664

Checking PHP Smarty templates Cache

i am using Smarty templates latest build 3.1.15. I wanted to enable templates caching and it works. I can see the templates created in the cache directory. However, whenever i want to check if there is a created cache file using the is_cache() method i get

php Fatal error: Uncaught --> Smarty: Call of unknown method 'is_cached'. <-- thrown in .... sysplugins\smarty_internal_templatebase.php on line 819

I just want to check if there is a cache using

echo (!$smarty->is_cached('home.tpl','home')) ;

and i display the cache by

$smarty->display('home.tpl','home');

Thanks

Upvotes: 0

Views: 821

Answers (1)

Garry Welding
Garry Welding

Reputation: 3609

For later versions of Smarty this method has actually been renamed to isCached(). Try that instead.

This method hasn't been is_cached() since Smarty 2. isCached() API Docs.

Upvotes: 2

Related Questions