(on Monday, 01 December 2008, 04:17 PM -0500):
> Environment: ZF 1.7.0
>
> I have a directory structure like:
> /application
> /modules
> /default
> /foo
> /controllers
> Foo_FooController.php
>
> My module and controller name are the same (foo) so I wind up with a URL
> like mysite.com/foo/foo/list where list is the action.
>
> However, I'm getting an exception saying "Invalid Controller Specified
> (foo)". My class name in Foo_FooController.php is FooController. I
> also tried Foo_FooController and got the same error. What do I need to
> name my controller class for ZF dispatcher to recognize it?
You're missing the boat here. :)
modules/
foo/
controllers/
IndexController.php -- class Foo_IndexController
FooController.php -- class Foo_FooController
BarController.php -- class Foo_BarController
Basically, the module name becomes a prefix -- in this case, 'foo'
becomes prefix 'Foo_', and then then controller class name is appended
to it.
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论