目录中找不到控制器

时间:2012-08-16 00:16:05

标签: php codeigniter codeigniter-routing

我从我的开发人员下载了一个项目到本地,几乎完成了,我必须纠正其中的一些问题。由于我是Code Igniter的新手,我无法弄清楚控制器文件在哪里?

的http://本地主机/ RIC /视图/存储/ 3 是我的URL,通过查看URL,控制器名称应为“view”,函数为“store”,但在我的控制器目录中,没有这样的文件。任何人都可以帮助我吗? 完整的路由就是这个

$route['default_controller'] = "site";
$route['scaffolding_trigger'] = "";

$route['classifieds'] = "site/classifieds";
$route['specials'] = "site/specials";
$route['hot'] = "site/hot";
$route['joinus'] = "site/joinus";
$route['faq'] = "site/faq";

$route['browse'] = "product/browse";
$route['browse/:any'] = "product/browse/$1";
$route['stcat/:any'] = "store/browse/$1";
$route['search/:any'] = "product/search/$1";
$route['searchstore/:any'] = "store/search/$1";


$route['view/product/:num'] = "product/getOne/$1";

$route['view/store/:num'] = "store/getOne/$1";

$route['view/article/:any'] = "article/get/$1";

1 个答案:

答案 0 :(得分:2)

我认为你正在使用.htaccess文件和rewriteRule?添加rewriteBase,试错法是最好的方法,因为我不知道你的结构是怎样的。

请向我们提供更多信息和更详细的帖子,以便我们为您提供更好的帮助。

再次阅读您的问题后

更新

重新阅读你的问题后。你是说你找不到viewcontroller?看看你的路由。我猜View是到另一个控制器的路由。因为大多数时候没有使用ViewController。它主要称为PlaneController,StoreController或UserController,它具有视图操作,而不是具有存储操作的ViewController。我希望这会有所帮助。

看到您添加路由文件的更新后,

更新2

    $route['view/store/:num'] = "store/getOne/$1";

就像我想的那样,你应该尝试使用getOne动作找到StoreController。祝你好运。