How CI can set the default controller in subdirectories

Source: Internet
Author: User
CI build large-scale application, need to create sub-folder

Create a folder under Application/controllers App1

There are multiple controllers in the App1 directory, ca.php,cb.php

I want to define the default controller under App1, such as set to CA, direct access .../app1 can be accessed directly app1/ca

Can it be implemented?


Reply to discussion (solution)

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

Modify the default controller $route [' default_controller '] = "";

You look at the manual to understand the route function of CI, you can also use him to reduce the URL pseudo-static

Your this you directly $route[' app1 '] = "APP1/CA"; You can do it.

Your this you directly $route[' app1 '] = "APP1/CA"; You can do it.



Thanks a lot

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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.