【发布时间】:2014-01-21 11:36:16
【问题描述】:
我正在使用 zend 框架 1.12.3。
index.php:
switch(strtolower($_SERVER['REQUEST_URI'])) {
case '/admin/':
define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/../application/admin'));
break;
case '/store/':
define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/../application/stoe'));
break;
default:
define('APPLICATION_PATH',
realpath(dirname(__FILE__) . '/../application/store'));
break;
}
管理控制器:
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$request = $this->getRequest();
$this->view->assign('title', 'Login Form');
$this->view->assign('username', 'User Name');
$this->view->assign('password', 'Password');
}
public function authAction()
{
echo 'test';exit;
}
当我访问网址时: http://pro.localhost/admin/ - 这是有效的
但是当我访问网址时: http://pro.localhost/admin/auth 显示错误“找不到页面”和“消息:指定的控制器无效(管理员)”
【问题讨论】:
-
显示您的 .htaccess 文件
-
您是否为 AuthAction 准备了相关的视图文件 auth.phtml?
标签: php zend-framework