-- Lepidosteus <[EMAIL PROTECTED]> wrote
(on Monday, 16 July 2007, 12:17 PM +0200):
> Hello,
> 
> I'm using a modular system, with a "modules" directory in which i have
> them, each containing it's own "controller", "models" and "views"
> directory.
> So far everything is working great.
> 
> Now I'm moving to zf 1.0 and I need to make the error controller.
> I'm not sure at how this would work:
> 
> http://myhost.com/module/wrongcontroller/ will invoke "module" error
> controller ?

No, it goes to the sitewide error controller, which is by default
ErrorController in the default module.

> Then what controller will be called if  the user goes to
> http://myhost.com/wrongmodule/ ?
> 
> And is there a way to regroup this error controllers ? What I would
> like to do is that, if the module is not correct, some error
> controller is called, but if the module is correct but not the
> controller, then another one is called the same whichever module you
> are in).
> 
> Is it possible, and how may I achieve this ?

Sure. There are several values set in the error_handler token, and you
can determine if it was invoked due to either an invalid controller,
invalid action, or general application exception. There is no way
currently to determine if the module was or was not correct, as the
router actually compares the request against the list of registered
modules before it attempts to dispatch (defaulting to 'default' if it
does not recognize the first path segment as a module).

Please see the ErrorHandler documentation for examples of how to handle
the various exception types:

    
http://framework.zend.com/manual/en/zend.controller.plugins.html#zend.controller.plugins.standard.errorhandler

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to