(on Monday, 05 January 2009, 10:02 AM -0500):
> I'm experiencing an issue in an application I am writing. I'm using ZF 1.7.1
> for the record.
>
> I'm trying to figure out the case sensitivity rules for Modules. We've been
> developing using the default module to this point, and there have been no
> problems. But in creating a new module, we've discovered that in the URL the
> module name must reflect the capitalization of the module directory in the file
> system.
>
> e.x.:
>
> application/modules/resources/ =>
> http://devsite.com/resources/ brings up the index controller/action
> http://devsite.com/Resources/ returns an exception: Invalid Controller
> Specified
>
> application/modules/Resources =>
> http://devsite.com/resources/ returns an exception: Invalid Controller
> Specified
> http://devsite.com/Resources/ brings up the index controller/action
>
> I guess that I have two questions here:
>
> 1) Is this the expected behavior?
Yes. The directory name should be lowercased and dot or dash separated:
application/
modules/
resources/
fun-stuff/
This will match how it is referred to in the url (which should be all
lowercase):
/resources/wiki/view
/fun-stuff/comics/list
In the classes themselves, use MixedCase to refer to the module prefix:
Resources_WikiController
FunStuff_ComicsController
> 2) If so, is there a 'best practices' method of forcing case insensitivity on
> the module name in the URL?
You'd need to write a local replacement for the Module route
(Zend_Controller_Router_Route_Module). Currently, it uses the above
conventions to ensure speed, and to ensure that a matching module
directory exists.
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论