4,250
社区成员
发帖
与我相关
我的任务
分享
<?php
error_reporting(E_ALL|E_STRICT);//开启错误报告
date_default_timezone_set('Asia/Shanghai');//配置地区
set_include_path('.' .PATH_SEPARATOR .'./library'.PATH_SEPARATOR .'./application/models/'.PATH_SEPARATOR . get_include_path());//配置环境目录
require_once "Zend/Loader/Autoloader.php";//载入zend框架
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true); //静态载入自动类文件
$registry = Zend_Registry::getInstance();//静态获得实例
/*
$view = new Zend_View();//实例化zend 模板
$view->setScriptPath('./application/views/scripts/');
$registry['view'] = $view;
*/
$config=new Zend_Config_Ini('./application/config/config.ini',null, true);
Zend_Registry::set('config',$config);
$dbAdapter=Zend_Db::factory($config->general->db->adapter,$config->general->db->config->toArray());
$dbAdapter->query('SET NAMES UTF8');
Zend_Db_Table::setDefaultAdapter($dbAdapter);
Zend_Registry::set('dbAdapter',$dbAdapter);
$frontController =Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('/zend2')
->setParam('noViewRenderer', true)
->setParam('useDefaultControllerAlways', true)
->setControllerDirectory('./application/modules')
->throwExceptions(true)
->dispatch();
?>
PHP Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Cannot load controller class "IndexController" from file "./application/modules\IndexController.php'' in D:\oratest\zend2\library\Zend\Controller\Dispatcher\Standard.php:347
Stack trace:
public function indexAction() {
$smarty = new Smarty(); //建立smarty实例对象$smarty
$smarty->templates("./templates"); //设置模板目录
$smarty->templates_c("./templates_c"); //设置编译目录
$smarty->cache("./cache"); //缓存目录
$smarty->cache_lifetime = 0; //缓存时间
$smarty->caching = true; //缓存方式
$smarty->left_delimiter = "{#";
$smarty->right_delimiter = "#}";
$smarty->assign("name", "zaocha"); //进行模板变量替换
$smarty->display("index.htm"); //编译并显示位于./templates下的index.htm模板
exit;
}
