奇怪的 控制器/动作 错误

#1 ☠天使不在线

1.jpg
文件结构如下
├─htdocs
│  ├─controllerss
│  │  ├─admin
│  │  │  ├─main.php
│  │  ├─index
│  │  │  └─main.php
│  ├─model
│  ├─Templates
│  │  ├─admin
│  │  │  └─images
│  │  └─index
│  │  │  └─images
│  ├─Templates_tmp

访问 http://localhost/index.php 时是正常的  

2.jpg
访问 http://localhost/admin.php的时候 控制器错误

E:\SpeedAMP\htdocs/controller/admin
E:\SpeedAMP\htdocs\admin.php
路由错误,请检查控制器目录下是否存在该控制器/动作。

  • E:\SpeedAMP\htdocs\SpeedPHP\spFunctions.php on line 17
12.      spLaunch("router_prefilter");
13.      // 对将要访问的控制器类进行实例化
14.      $handle_controller = spClass($__controller, null, $GLOBALS['G_SP']["controller_path"].'/'.$__controller.".php");
15.      // 调用控制器出错将调用路由错误处理函数
16.      if(!is_object($handle_controller) || !method_exists($handle_controller, $__action)){
17.          eval($GLOBALS['G_SP']["dispatcher_error"]);

18.          exit;
19.      }
20.      // 路由并执行用户代码
21.      $handle_controller->$__action();
22.      // 控制器程序运行完毕,进行模板的自动输出


  • E:\SpeedAMP\htdocs\admin.php on line 11
6. echo $spConfig['controller_path'];
7. echo "
";
8. echo __FILE__;
9. // 载入SpeedPHP框架
10. require(SP_PATH."/SpeedPHP.php");
11. spRun(); // SpeedPHP 3新特性




其中入口文件有下面一句
$spConfig['controller_path'] = APP_PATH.'/controller/'.basename(__FILE__,".php");

2012-10-18 14:09:35

#2 jake

看手册,下例子来对比

2012-10-18 14:26:56