How do you use multiple controllers in CodeIgniter?

后端 未结 3 1572
别跟我提以往
别跟我提以往 2021-01-13 19:44

I\'m new to CodeIgniter and I\'ve just gone through some of their user guide to help me understand how to do multiple controllers.

I have figured out how to load mul

3条回答
  •  礼貌的吻别
    2021-01-13 20:20

    The problem is your calling method In your case if you don't have mod_rewrite on you should try

    localhost/website/index.php/mycontroller
    

    if you are able to activate mod_rewrite you can add in your .htaccess the following lines:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1
    

    after that you can call your controller like you tried before

提交回复
热议问题