2010年1月25日星期一

Re: [fw-mvc] Stop Dispatching Process not working

Hello,

is it possible to Implement a Hook/Callback to stop dispatching in the FrontController in a official version of ZF ?

Thanks
Marcel


Am 22.01.2010 um 17:17 schrieb Marcel Alburg:

> Hi,
>
>
> i played with ZF 1.10beta and wrote a Zend_Controller_Plugin
>
> class Default_Plugin_Cache extends Zend_Controller_Plugin_Abstract
> {
> public function preDispatch(Zend_Controller_Request_Abstract $request)
> {
> ...
> $request->setDispatched(false);
> ...
> }
> }
>
> this should stopping the dispatching process but it not works. The snipped (Zend_Controller_Request_Abstract::setDispatched(false);) from the ZF Doku works not too.
>
> if i look in the Zend/Controller/Front.php line 941 i found this
>
> $this->_plugins->preDispatch($this->_request);
>
> /**
> * Skip requested action if preDispatch() has reset it
> */
> if (!$this->_request->isDispatched()) {
> continue;
> }
>
> i wonder because a continue begins the while loop again. if i change continue to break it works correctly for me.
>
>
> Marcel

没有评论: