require_once('smarty/libs/Smarty.class.php'); $smarty = new Smarty(); // Template caching is enabled by default // Clear the cache $smarty->clearSmartyCache(); // Display the template $smarty->display('home.tpl');
require_once('smarty/libs/Smarty.class.php'); $smarty = new Smarty(); // Disable template caching $smarty->caching = false; // Display the template $smarty->display('home.tpl'); // Enable template caching $smarty->caching = true; // Clear the cache $smarty->clearSmartyCache();In this example, the template caching is first disabled, and then the "home.tpl" template is displayed. Later, the caching is enabled again and the cache is cleared. Package/library: Smarty template engine library.