+ -
当前位置:首页 → 问答吧 → zend framework一个问题请大家帮忙

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 


我要怎么才可以解决此问题呢

作者: shnnui   发布时间: 2011-05-04

http://a.my.com/auth/login/index
试试这个路径。我觉得你的目录结构好乱。

作者: A82168506   发布时间: 2011-05-04