Where exactly are you executing var_dump("TESTING");?
It's possible that the plugin event methods are executed more than
once. Consider the following actions:
public function fooAction()
{
echo 'fooAction()<br />';
$this->_forward('bar');
}
public function barAction()
{
echo 'barAction()<br />';
}
if you then register this controller plugin:
class Vendor_Controller_Plugin_Test extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$this->getResponse()->appendBody('preDispatch()<br />');
}
}
you'll get the following output when calling fooAction:
preDispatch()
fooAction()
preDispatch()
barAction()
This will happen whenever you use _forward (could be triggered in
another controller plugin - e.g. to forward non-authenticated users -
too!) and is expected behaviour. I guess the same applies to the
action() view helper.
hope this helps.
2010/6/14 Enkhbilguun Erdenetsogt <[email protected]>:
> Hello everyone,
> I just found that CUSTOM_Controller_Plugin is loaded twice. I don't think it
> is normal.
> I'm using ZF 1.10.5 and application.ini registers my Controller Plugins
> like resources.frontController.plugins.Testo = "MY_Controller_Plugin_Testo".
> I just var_dump("TESTING"); in Testo Controller Plugin and the message is
> displayed twice in my browser.
> Do you know how to avoid such duplicated load?
>
>
> ---
> Enkhbilguun Erdenetsogt