CI框架配置smarty
时间:2011-04-03 来源:greengnn
<?php// load Smarty library
require_once(APPPATH.'libraries/smarty/Smarty.class.php');
class CI_smarty extends Smarty {
function __construct() {
parent :: __construct();
$this -> template_dir = APPPATH . 'views/';
$this -> compile_dir = APPPATH . 'cache/compile/';
$this -> config_dir = APPPATH . 'config';
$this -> cache_dir = APPPATH . 'cache/';
$this -> left_delimiter = '<%';
$this -> right_delimiter = '%>';
$this->caching = true;
$this->testInstall();
@$this -> clear_all_cache();
// $this->config_load('site.conf');
parse_str($_SERVER['QUERY_STRING'],$_GET);
$_GET = array_map('urldecode', $_GET);
if (isset($_GET["_d"]) && $_GET["_d"] == 1) {
$this -> debugging = true;
}
}
function set($key, $val) {
$arr = array();
$arr['v'][$key] = $val;
//print_r($arr);
$this -> assign($arr);
}
}
?>
相关阅读 更多 +