我正在使用zend框架1.12.3。控制器在zend中不起作用
的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 显示错误'找不到页面'和'消息:无效控制LER规定(管理员)“
显示您的.htaccess文件 – emaillenin
您是否拥有AuthAction的相关视图文件auth.phtml? – user466764