2010年1月23日星期六

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

I suppose the code does exactly what it was ment to. Imho the point of the continue statement is, that a plugin is able to forward to another module/controller/action. In this case you probably would modify the request and setDispatched(false) in order to re-run the dispatching process.

As far as I can tell stopping the dispatcher is not possible at the moment. As a workaround you could forward to an empty action.

On 22.01.2010, at 17:17, Marcel Alburg wrote:

> 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
> --
> Weeaar
> Web- und Softwareentwicklung
>
>
> http://www.weeaar.com/
>
>
> Tel: +49 (0)30 2089 6809
> Mail:
> m.alburg@weeaar.com
>
>
> SteuerID: 049 / 200 / 00385
> Inhaber: Marcel Alburg
>
> -------
>
> <banner_728x90.png>
>
> www.beatboat.de - Dein Musikpreisvergleich
> Nominiert für den Onlinestar 2009
>
> -------
> Diese Information ist ausschliesslich fuer den Adressaten bestimmt und
> kann vertraulich oder gesetzlich geschuetzte Informationen enthalten.
> Wenn Sie nicht der bestimmungsgemaesse Adressat sind, unterrichten Sie
> bitte den Absender und vernichten Sie diese Mail. Anderen als dem
> bestimmungsgemaessen Adressaten ist es untersagt, diese E-Mail zu lesen,
> zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch
> immer zu verwenden.
>
> The information contained in this email is intended only for its
> addressee and may contain confidential and/or privileged information. If
> the reader of this email is not the intended recipient, you are hereby
> notified that reading, saving, distribution or use of the content of
> this email in any way is prohibited. If you have received this email in
> error, please notify the sender and delete the email.
>
>
>

没有评论: