-- SiCo007 <[EMAIL PROTECTED]> wrote
(on Wednesday, 24 October 2007, 08:12 AM -0700):
> I'm fairly new the Zend Framework. I'd like to move my overall Error Handler
> in to an Error Module. However I can't get it to work.
> 
> Everything works fine with the default error handler but then I try to use
> the following code and it simply redirects every request to the default
> modules Index Controller / Action.
> 
> require_once('Zend/Controller/Plugin/ErrorHandler.php');
> $front->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array(
>     'module' => 'Error',
>     'controller' => 'Index',
>     'action' => 'Index'
> )));

First off, it's typically better to specify module, controller, and
action names using lowercase. Second, do you have an 'error' module?

Could you send your full bootstrap? that may help me better diagnose the
issue.

> The code came from an example on this list. How do I go about getting an
> instance of the class? Nothing seems to be returned if I use:
> 
> $errorHandler = $front->getPlugin('Zend_Controller_Plugin_ErrorHandler');

That will only work if the plugin has already been registered. By
default, registration of the plugin is deferred to dispatch() to prevent
instantiating it if the user does not want it. It *will* be available if
you register it manually with registerPlugin() )before calling
getPlugin(), however.

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

Reply via email to