Welcome Guest, Not a member yet? Register   Sign In
Is "Directory" a reserved word?
#1

[eluser]fesweb[/eluser]
I would like to create a controller named directory, but it refuses to work until I change the name to directory2.

In looking at the reserved words list for code igniter, I don't see a problem - and I can't find a similar list for php itself.

What am I missing?

Thanks.
#2

[eluser]bastones[/eluser]
Can I see your code, specifically the Controller code? Not sure if anyone can do much without it.
#3

[eluser]fesweb[/eluser]
Here it is.
http://foo.com/directory/ does not work (blank page):
Code:
class Directory extends Controller {

    function Directory()
    {
        parent::Controller();
    }
    
    function index()
    {
        echo 'Hello';
    }
    
}
But http://foo.com/directory2/ does:
Code:
class Directory2 extends Controller {

    function Directory2()
    {
        parent::Controller();
    }
    
    function index()
    {
        echo 'Hello';
    }
    
}
#4

[eluser]Colin Williams[/eluser]
It's reserved by PHP, not CI. Pretty sure it's used by the PHP dir() function

Code:
print_r(get_class_methods('Directory'));
#5

[eluser]dcunited08[/eluser]
[url="http://us2.php.net/manual/en/class.dir.php"]PHP Man[/url]
#6

[eluser]fesweb[/eluser]
Thanks. I figured, but my searches weren't turning up anything...




Theme © iAndrew 2016 - Forum software by © MyBB