目录结构:

.htaccess写法:
RewriteEngine on
RewriteBase /
RewriteRule !.(js|ico|txt|gif|jpg|png|css)$ index.php
首页dispatch:
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';
$loader = Zend_Loader_Autoloader::getInstance();
// require_once 'Zend/Loader.php';
//Zend_Loader::registerAutoload();//设置Zend Framework 自动载入类文件
$registry = Zend_Registry::getInstance();
//设置模板显示路径
$view = new Zend_View();
$view->setScriptPath('./application/views/scripts/');
$registry['view'] = $view;//注册View
//设置控制器
$frontController =Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('/zendframework')//设置基本路径
->setParam('noViewRenderer', true)
->setControllerDirectory('./application/controllers')
->throwExceptions(true)
->dispatch();
?>
| 最近读者 (登录后,您就出现在这里。这里登陆) | |||||||||
评论读取中...