<?PHPDefine("ROOT",Str_replace("\\","/",dirname(__file__)).‘ /‘);//The root directory of the project is specified in the constant root. \ \ escape character, convert \ to/.//echo str_replace ("\ \", "/", DirName (__file__)). " /";//Find the directory for the specified projectrequireROOT. ' Libs/smarty.class.php ';//loading the Smarty class file$smarty=NewSmarty ();//instantiate Smarty Object <br>//$smarty, auto_literal = false;//You can let the bounding symbol use spaces$smarty->settemplatedir (ROOT. ' Templates/');//set the location of all template files//$smarty->addtemplatedir (ROOT. ' Templates2/'); Add a template folder$smarty->setcompiledir (ROOT. ' Templates_c/');//set the directory where the compiled template resides$smarty->addpluginsdir (ROOT. ' Plugins/');//set as template extension to store directory$smarty->setcachedir (ROOT. ' cache/');//Set cache file storage directory$smarty->setconfigdir (ROOT. ' Configs/');//Setting the template configuration file to store directory$smarty->caching =false;//Setting the smarty cache switch function$smarty->cache_lifetime = 60*60*24;//set the cache template to a valid time of day$smarty->left_delimiter = ' <{';//set the left terminator in the template language$smarty->right_delimiter = '}> ';//set the right terminator in the template language?>
Smarty Initial configuration, file storage path