Set cache directory
public setCacheDir ( string $cache_dir ) : Smarty | ||
$cache_dir | string | directory to store cached templates in |
return | Smarty | current Smarty instance for chaining |
$smarty->setCacheDir('/path/to/cache');
$smarty->setCacheDir('/path/to/cache/');
$smarty->setCacheDir('./cache');This sets the cache directory to a subdirectory named "cache" in the current directory. This method is part of the Smarty package library, which is a popular template engine for PHP. It provides a simple way to separate the presentation layer from the application logic, making it easier to maintain large PHP applications. The caching feature of Smarty helps improve performance by reducing the time taken to render frequently accessed templates.
public setCacheDir ( string $cache_dir ) : Smarty | ||
$cache_dir | string | directory to store cached templates in |
return | Smarty | current Smarty instance for chaining |