1

私はいくつかのコントローラーイベントで遊んだことがありますが、リダイレクトが呼び出されないときに呼び出されるものを特定できませんでした。cms_pageview も調べましたが、他のすべてのページ タイプに相当するものはありません。リダイレクトがトリガーされないスタックで後で呼び出されるイベントや、リダイレクトが要求されたかどうかを確認する方法はありますか?

4

1 に答える 1

1

There are a lot of dynamic and generic events which you can consume; best to describe your needs.

Provided that the request is dispatched through the Front Controller, the response is sent in dispatch(), and that response may include a redirect header; you should be able to read the response object headers or status code to see if a redirect has been set.

if (Mage::app()->getResponse()->isRedirect()) {
    //this will work assuming that the status code has been set
}

For more see Zend_Controller_Response_Abstract.

于 2013-03-31T23:02:35.043 に答える