why happen this with capital case on presenters

Notice: This thread is very old.
alnux
Member | 139
+
0
-

Ok i have the next presenter

class AppKeyPresenter extends BackendBasePresenter{

    //-- Renders -----------------------------------------------------------------------------------------
    public function renderDefault()
    {
        $this->template->title = $this->translator->translate("App Key");
    }

}

but when i try to render with

http://nette.start/admin/appkey/

it show me the next warning

Case mismatch on class name 'App\Backend\Presenters\AppkeyPresenter', correct name is 'App\Backend\Presenters\AppKeyPresenter'.

or

Case mismatch on presenter name 'Backend:Appkey', correct name is 'Backend:AppKey'

the letter k have to be on capital case K, so i change on browser to

http://nette.start/admin/appKey/

now show me an exception

Nette\Application\BadRequestException #404

No route for HTTP request.

I have no choice to rename my presenter to AppkeyPresenter, but this has me confused because I have other presenters as

BlackIpPresenter
WhiteProxyPresenter

and them do not have this problem

Last edited by alnux (2015-04-19 17:54)

Martk
Member | 661
+
+1
-

Have you tried rewrite appkey to app-key ?

http://nette.start/admin/app-key/

If you want appkey you must rename presenter to AppkeyPresenter or change routes.

Last edited by Antik (2015-04-20 20:53)

Armin Schmidtke
Member | 20
+
0
-

In case you want to route to:

http://nette.start/admin/appkey/

your presenter and class name should be AppkeyPresenter.

In your case (PascalCase: AppKeyPresenter) the matching route is:

http://nette.start/admin/app-key/