Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 CamelCase problem with routes and helpers #4821

Closed
Xety opened this issue Oct 6, 2014 · 5 comments
Closed

3.0 CamelCase problem with routes and helpers #4821

Xety opened this issue Oct 6, 2014 · 5 comments

Comments

@Xety
Copy link
Contributor

Xety commented Oct 6, 2014

Hello,
I'm using custom routes in my app, like these routes :

//Public routes.
Router::scope('/', function ($routes) {

    $routes->connect('/', ['controller' => 'pages', 'action' => 'home']);

    //Blog Routes.
    $routes->connect(
        '/blog/article/:slug',
        [
            'controller' => 'blog',
            'action' => 'article'
        ],
        [
            '_name' => 'blog-article',
            'pass' => [
                'slug'
            ]
        ]
    );

    $routes->connect(
        '/blog/category/:slug',
        [
            'controller' => 'blog',
            'action' => 'category',

        ],
        [
            '_name' => 'blog-category',
            'pass' => [
                'slug'
            ]
        ]
    );

    $routes->fallbacks();
});

As you can see, all the controllers names are in lowercase. These routes work perfectly in localhost but not on my server => pagesController doesn't not exist, You can see the error here : http://xeta.io

And i have exactly the same error with Helpers : (work in localhost, but not on the server)
7jiyxcf
So, my question is :
Is that normal i get an error or not ?
If yes, why you don't convert any helper/controller name with ucfirst ?

For information, i have the same configuration in my dev environment and in my production environment.

@antograssiot
Copy link
Contributor

You should maybe have a look to #4729

@antograssiot
Copy link
Contributor

@Xety
Copy link
Contributor Author

Xety commented Oct 6, 2014

@antograssiot Thanks you, that fixed all the routes problems.
And about the helpers names ? I had the same problem in Cake2 too. (About helper name)

@ADmad
Copy link
Member

ADmad commented Oct 6, 2014

@Xety Take care of casing when specifying class names. It shoul be "Html" not "html". Since windows file system is case insensitive it works for you locally, but will generate error on Linux servers.

@Xety
Copy link
Contributor Author

Xety commented Oct 6, 2014

@ADmad Ah ok that's due to the OS System, thanks for that information, i didn't know. ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants