CI如何在子目录下可以设置默认控制器

WBOY
Release: 2016-06-23 13:51:20
Original
865 people have browsed it

CI建立大型大型的应用程序,需要创建子文件夹

在application/controllers下建立文件夹app1

app1目录下有多个控制器,ca.php,cb.php

我希望定义app1下的默认控制器,如设置成ca,直接访问.../app1就可以直接访问app1/ca

可以实现吗?


回复讨论(解决方案)

http://codeigniter.org.cn/user_guide/general/routing.html

修改默认控制器  $route['default_controller'] = "";

你看看手册了解ci的路由功能,你也可以用他缩减url  伪静态

你的这个你直接$route['app1'] = "app1/ca"; 就可以了

你的这个你直接$route['app1'] = "app1/ca"; 就可以了



多谢

$route['app1/(:any)'] = 'app1/$1';

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template