Welcome Guest, Not a member yet? Register   Sign In
Controllers sub directory have identical controller
(This post was last modified: 11-09-2015, 06:20 PM by Jheysoon.)

    is this a bug ??
I have a controller sub-directory named registrar and also i have a controller named Registrar.php
Whenever i access the sub directory registrar and have a Registration.php i encounter a Page not Found ..

example :: http://localhost/registrar/registration/register...

But when i access the Registrar.php
like :: http://localhost/registrar/method .. it is ok..

But when i renamed the registrar folder it works..

I just want to confirmed if it is a bug...

Sample directory above...

The router will search for a class at first place and after that for dir / class..

In your case it finds class Registrar and there is no method registration so it fails..
Best VPS Hosting : Digital Ocean

So CI must have a fallback method for this kind of situation ..??
To search for a controllers/directory/class/method/parameters ...
If it fails to find the controllers/class/method/parameters ...

Thanks for the reply..

Fallback? CodeIgniter has rules it applies for routing, and developers should avoid having folders and classes with the same name. This may become a non-issue with CI4, but we have to live with what we have for now Undecided

I think that the Default Searching should be as it is
1st - Controller > Method
2nd - Directory > Controller > Method

Don't forget that the routing is auto create for this type of routes. You are always able to define your custom rules at the route configuration..
Best VPS Hosting : Digital Ocean

Theme © iAndrew 2016 - Forum software by © MyBB