Welcome Guest, Not a member yet? Register   Sign In
I have a subdirectory in my controllers folder - possibly to set default controller?
#7

Hm. It would seem that a default controller in a subdirectory cannot have methods other than index?

For example, I have a subdirectory with a default controller in it:
PHP Code:
// application/controllers/subdir/Welcome.php
defined('BASEPATH') OR exit('No direct script access allowed');

class 
Welcome extends MY_Controller {
     public function 
_remap($method) {
        echo 
"calling " __METHOD__ " with \$method=" $method;
     }
// class subdir/Welcome 
My intuition says that this _remap function should kick in when any method in the subdir folder is called:
http://example.com/subdir
http://example.com/subdir/foo
http://example.com/subdir/bar

However, I get 404/not found for both the foo and bar urls. I am forced to define other controller classes to get those urls served.

Is this supposed to be the case? Is there no way to define a default controller in a subdirectory that handles *all* requests for that subdir?
Reply


Messages In This Thread
RE: I have a subdirectory in my controllers folder - possibly to set default controller? - by sneakyimp - 10-28-2016, 12:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB