2009年1月29日星期四

Re: [fw-mvc] Invalid controller specified

-- hlaiken <heath.aiken@gmail.com> wrote
(on Wednesday, 28 January 2009, 07:42 PM -0800):
> I think that for actions, the only capitalization allowed is is the "A" in
> action (e.g. fooAction). I feel like this may have bitten me once, and that
> it worked in the WAMP environment, but as soon as I went to LAMP, it broke.

Actually, you can have camelCasedActionNames -- but you have to specify
them on the URL differently. camelCasing indicates discrete words, so on
the URL, by default, we normalize to lowercase and use a word separator.
myUberCoolCamelCasedAction would be referred to as
'my-uber-cool-camel-cased' on the URL. The same thing goes for
controllers; if there is MixedCasing happening, then you need to specify
a word separator prior to each Capital letter. MyUberCoolController is
referred to as 'my-uber-cool' on the URL. If you have multiple Capitals
following eachother, those are considered discrete words; so, MyFOO
becomes 'my-f-o-o' on the URL.

The same rules are used when resolving the controller and action names
to view scripts. MyUberCoolController::awesomeCoolAction() will map to
the view script my-uber-cool/awesome-cool.phtml.

If you follow those rules, then the issues between case normalization on
different OSes go away.

> markusw wrote:
> >
> > Hi all,
> > some strange thing where I can't find the error.
> >
> > This is the error I get when requesting a page with a link like this:
> > http://.../DownloadEXCEL/Training
> >
> > On my desktop at home everything is ok. This is a Windows machine. On my
> > server (Linux) I get this error. All other pages are working. I am pretty
> > sure there is a problem with the filesystem or permissions but I don't
> > know where and how to identify a little more detailed.
> >
> > Exception information:
> >
> > Message: Invalid controller specified (DownloadEXCEL)
> > Stack trace:
> >
> > #0 /.../v3library/Zend/Controller/Front.php(934):
> > Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> > Object(Zend_Controller_Response_Http))
> > #1 /.../v3sms/application/bootstrap.php(231):
> > Zend_Controller_Front->dispatch()
> > #2 /.../v3sms/public/index.php(47): require('/...')
> > #3 {main}
> >
> >
> > A second thing where I am a little confused is the following. The
> > controllers are all with a upper case first char. But the view scripts
> > folders are with a lower case first char. And the folder name has a "-"
> > when there is a upper case char in the middle of the folder name. So e.g.
> > the folder for the view script of my DownloadEXCEL controller looks like
> > this: download-EXCEL
> >
> >
> > Any ideas?
> >
> > BR Markus
> >
>
> --
> View this message in context: http://www.nabble.com/Invalid-controller-specified-tp21717047p21720381.html
> Sent from the Zend MVC mailing list archive at Nabble.com.
>

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: