zend framework一个问题请大家帮忙
时间:2011-05-04
来源:互联网
大家好
新人问个问题
我的index.php是这样写的
set_include_path('.' .
PATH_SEPARATOR . '../library/'.
PATH_SEPARATOR . '/application/models/'.
PATH_SEPARATOR . get_include_path());
require_once 'Zend/Controller/Front.php';
$fc->setControllerDirectory(array(
"default"=>'./application/controllers/',
"auth"=>'./modules/auth/controllers/',
));
//开始运行程序
$fc->dispatch();
目录结构如下
application/
controllers/
IndexController.php
models/
views/
scripts/
index/
index.phtml
modules
auth/
controllers/
IndexController.php
views/
scripts/
login/
index.phtml
.htaccess
index.php
library
我在auth下LoginController.php
的代码如下
require_once 'Zend/Controller/Action.php';
class LoginController extends Zend_Controller_Action
{
public function indexAction()
{
echo 'Hello';
}
public function testAction()
{
echo '我们一起向前';
}
}
打开http://a.my.com/login/index
老是提示
( ! ) Zend_Controller_Dispatcher_Exception: Invalid controller specified (login) in E:\zend_framework\library\Zend\Controller\Dispatcher\Standard.php on line 248
我要怎么才可以解决此问题呢
新人问个问题
我的index.php是这样写的
set_include_path('.' .
PATH_SEPARATOR . '../library/'.
PATH_SEPARATOR . '/application/models/'.
PATH_SEPARATOR . get_include_path());
require_once 'Zend/Controller/Front.php';
$fc->setControllerDirectory(array(
"default"=>'./application/controllers/',
"auth"=>'./modules/auth/controllers/',
));
//开始运行程序
$fc->dispatch();
目录结构如下
application/
controllers/
IndexController.php
models/
views/
scripts/
index/
index.phtml
modules
auth/
controllers/
IndexController.php
views/
scripts/
login/
index.phtml
.htaccess
index.php
library
我在auth下LoginController.php
的代码如下
require_once 'Zend/Controller/Action.php';
class LoginController extends Zend_Controller_Action
{
public function indexAction()
{
echo 'Hello';
}
public function testAction()
{
echo '我们一起向前';
}
}
打开http://a.my.com/login/index
老是提示
( ! ) Zend_Controller_Dispatcher_Exception: Invalid controller specified (login) in E:\zend_framework\library\Zend\Controller\Dispatcher\Standard.php on line 248
我要怎么才可以解决此问题呢
作者: shnnui 发布时间: 2011-05-04
http://a.my.com/auth/login/index
试试这个路径。我觉得你的目录结构好乱。
试试这个路径。我觉得你的目录结构好乱。
作者: A82168506 发布时间: 2011-05-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28