Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 router function set_directory
#1

[eluser]searain[/eluser]
In CodeIgniter 1.7.2

Code:
function set_directory($dir)
    {
        $this->directory = $dir.'/';
    }

CI 2.0

Code:
function set_directory($dir)
    {
        $this->directory = str_replace(array('/', '.'), '', $dir).'/';
    }

So in CI 1.7.2, I can call set_directory() to set up multiple levels nested controllers subfolders. But in CI 2.0, it seems that it specifically replace the '/', don't allow I use set_directory() to set up multiple levels nested controllers subfolders/

What is the logic that CI 2.0 use

Code:
function set_directory($dir)
    {
        $this->directory = str_replace(array('/', '.'), '', $dir).'/';
    }

Instead of
Code:
function set_directory($dir)
    {
        $this->directory = $dir.'/';
    }

If I override the
Code:
function set_directory($dir)
    {
        $this->directory = str_replace(array('/', '.'), '', $dir).'/';
    }

replace it with old
Code:
function set_directory($dir)
    {
        $this->directory = $dir.'/';
    }

What would be the consequence?

CI make this change for a reason and I don't want to override it back to old codes without knowing the reason.

Thanks!
#2

[eluser]searain[/eluser]
Any advices?

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB