代码如下:
<?php
require('Smarty.class.php');
class initialize_smarty extends Smarty
{
function initialize_smarty() //构造函数
{
$this->Smarty();
$this->template_dir="../smart/templates/";
$this->config_dir="../smart/configs/";
$this->cache_dir="../smart/cache/";
$this->compile_dir="../smart/templates_c/";
$this->caching = true;
}
}
?>
在以后的文件中只需要包含此文件初始化 initialize_smarty 这个类就行了
<?php
require('Smarty.class.php');
class initialize_smarty extends Smarty
{
function initialize_smarty() //构造函数
{
$this->Smarty();
$this->template_dir="../smart/templates/";
$this->config_dir="../smart/configs/";
$this->cache_dir="../smart/cache/";
$this->compile_dir="../smart/templates_c/";
$this->caching = true;
}
}
?>
在以后的文件中只需要包含此文件初始化 initialize_smarty 这个类就行了