Understand, in this world, there are only two kinds of dogs. There are stray dogs and tamed dogs. In exchange for freedom, stray dogs wander in the rain and eat the food called "insecurity". Or tamed dogs who are chained by a collar and eat the food called "slavery". Which one are you?

Invalid controller specified - Zend Framework

Saturday, August 30th, 2008   by Favio

I just lost some time doing the WTF dance, so I’m taking a few minutes to make this note for future reference. Also, because I have a very fragile memory.

One of the common errors that new users of ZF get, is the “Invalid controller specified” error. Which means exactly that. But what happens when you did make sure that you setup the controller directory, and you created the controller in that place?

The answer is a question: are you following the ZF Controller naming conventions?

Here they are for your enjoyment:

For a controller to be resolvable, its filename must be in the following format:

XxxxxxxxController.php

where “X” represents any capitalized letter, and “x” any lowercase letter.

So, let’s say you have a controller that provides SOAP functionality: you can’t name it SOAPController.php, you must name it SoapController.php. A very small difference to have in mind that can save you from multiple WTFs. This information refers only to filenames. Not the class names that are in the code.

Hopefully, by doing this little post, this knowledge has been imprinted on my brain. I have my doubts.

This entry was posted on Saturday, August 30th, 2008 at 9:24 am and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

A reply to “Invalid controller specified - Zend Framework


Leave a Reply





Old and not that old articles

« How to embed flash content in web pages (for the busy person)