search

Home  >  Q&A  >  body text

Modify the default controller file in CodeIgniter

I am using CodeIgniter framework for my project. While using CodeIgniter, I discovered that "Welcome.php" is CodeIgniter's default controller file. But I want to make another file "Home.php" as my default controller.

I tried to put in the "routes.php" file in the configuration folder $route['default_controller'] = 'welcome';Change to $route['default_controller'] = 'home'; But it didn't work.

P粉205475538P粉205475538454 days ago514

reply all(1)I'll reply

  • P粉793532469

    P粉7935324692023-09-17 18:46:21

    According to the description of document

    If you use $route['default_controller'] = 'welcome';, then it will call

    Welcome::index()

    So when you change to

    $route['default_controller'] = 'home';

    You should haveHome::index()

    reply
    0
  • Cancelreply