doctrine 与 smarty 合并使用

来源:互联网 发布:字典转json 去掉制表符 编辑:程序博客网 时间:2024/05/16 14:31

<?php
require_once('setpath.php');
require_once(APPROOT.'DoctrineLib/Doctrine.php');
require_once(APPROOT.'SmartyLib/Smarty.class.php');
spl_autoload_register(array('Doctrine', 'autoload'));
$doctrineManager=Doctrine_Manager::getInstance();
$doctrineManager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);
$doctrineManager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
$conn=Doctrine_Manager::connection('mysql://root@localhost/b2b2c','PrimaryLink');
spl_autoload_register(array('Doctrine_Core', 'modelsAutoload'));
$conn->setCharset('utf8');
Doctrine_Core::loadModels(APPROOT.'Models');
$tplCore=new Smarty();

$tplCore->cache_lifetime=30;

$tplCore->template_dir=APPROOT.'Templates/';
$tplCore->compile_dir=APPROOT.'Templates_c/';
$tplCore->config_dir=APPROOT.'Configs/';
$tplCore->cache_dir=APPROOT.'Cache/';

?>

原创粉丝点击