2008年12月1日星期一

Re: [fw-mvc] Controller class naming when using modules

Class name should be the same as file name: Foo_FooController. In
addition don't forget to add new controller directory.
It should look something like this in your bootstrap file:

$frontController->addControllerDirectory(ROOT_PATH .
'/application/modules/foo/controllers', 'foo');

--
Aurelijus Valeiša
http://www.Aurelijus.eu

On Mon, Dec 1, 2008 at 11:17 PM, Jim Mullen <jim@idimensionz.com> wrote:
> 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?
>
> Thanks!
>
>

没有评论: