Change default controller file in codeigniter

时间:2018-02-03 07:48:43

标签: php codeigniter

I am using CodeIgniter framework for my project. While working with CodeIgniter, i found that "Welcome.php" is the default controller file in CodeIgniter. But i want to make another file "Home.php" as my default controller.

I tried changing $route['default_controller'] = 'welcome'; to $route['default_controller'] = 'home'; in the "routes.php" file in config folder but it didn't work.

1 个答案:

答案 0 :(得分:2)

According to the documentation

If you are using $route['default_controller'] = 'welcome'; then it will call

Welcome::index()

So, as you are changing to

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

You should have Home::index()