0

我的本地主机(localhost/supplies/)中有一个应用程序,并且在 routes.php 文件中指定了默认控制器。

$route['default_controller'] = "start";

问题是当我想在 URL 为“localhost/supplies/admin/”或“localhost/supplies/admin”时加载或执行控制器。

我做了测试

$route['admin'] = "controllers/admin";

但它不起作用。

4

2 回答 2

0

只需使用

$route['admin'] = "admin/yourcontrollerName";
于 2013-02-08T05:33:54.610 回答
0

If your application root is in localhost/supplies there is no reason to route that.

URL localhost/supplies/admin will call the admin controller without need for any routing.

(Works if you omitted index.php from the URL.)

Your suggested routing would call the method admin in the controller named controller

于 2013-02-07T21:46:34.513 回答