English 中文(简体)
无效主计长 Specised Error, 即使控制员在场
原标题:Invalid Controller Specified Error, even though the controller is present

我有一个叫MendItem的 came子控制器名称。 而且,我也为这一特别控制员创造了一条路子。

    $routeMenuItem = new Zend_Controller_Router_Route( /menu-item/:action/:menu/:parent/:id/* , array(
         controller     =>  MenuItem ,
         action         =>  index ,
         menu           => 1,
         parent         => 0,
         id             => 0        
    ));

No, when I navigate to this road Lets comment /menu-item/index/2 我发现了一个错误,Invalid Controller specified (MenuItem)差错。

但 我在在气温环境中探索时正遇到这一问题。 但是,在Windows环境中开发过程中,它优质

如何解决这一问题?

More Information

Controller:

File Name: MenuItemController.php
Class Name: MenuItemController

追查

#0 /../library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /../library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /../library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /../public/index.php(25): Zend_Application->run()
#4 {main}   

请求参数

array (
   action  =>  index ,
   menu  =>  2 ,
   controller  =>  MenuItem ,
   parent  => 0,
   id  => 0,
)
最佳回答

这是因为Windows并非是敏感的,而基于六氯环己烷的操作系统是敏感的。

From the ZendFramework manual:

Zend_Controller’s dispatcher then takes the controller value and maps it to a class. By default, it Title-cases the controller name and appends the word Controller. Thus, in our example above, the controller roadmap is mapped to the class RoadmapController.

This means that MenuItemController.php and MenuitemController.php are two different things, thus the autoloader is unable to find a match.

As a rule, when using multi word controllers just make sure that only the first letter of the class and the C in controller is capitalized.

问题回答

I had a very similar problem in the past (I was also developing in Windows and deploying the application to a Linux server). My solution was to rename the classes and files, to remove the uppercases. In your case, it would be:

File Name: MenuitemController.php
Class Name: MenuitemController




相关问题
VS 2008 : How to publish with out DLLs?

I have developed a web application in Visual Studio 2008 and want to publish it in to the production server. I see a publish option there.But its producing files with DLL. I dont want to publish only ...

Apache: Deploying a new site to the server

I have a site currently live on a domain. I would like to switch it to a new site, that is currently in a password protected sub directory on this server. I have a "Site Maintenance in Progress" page....

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Pylons deployment questions

I m a beginner with Pylons and I ve mostly developed on my localhost using the built-in web server. I think it s time to start deployment for my personal blog, I have a Debian Lenny server with ...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

Need advice on my PHP development solution

Here is how our current php development solution is set up: Each developer work on their local machine. Each developer commit their change to a common SVN server (intranet). A commit hook upload the ...

loading from JAR files during deployment vs development

when i am loading some data into my java program, i usually use FileInputStream. however i deploy the program as a jar file and webstart, so i have to use getRessource() or getRessourceAsStream() to ...