3

Magentoサイトがあります。

私はコントローラーを持っていますが、このコントローラーの別の機能にリダイレクトするにはどうすればよいですか?

つまり、2つの機能があります。

1.test()


i want to redirect from test1() to test2()

これどうやってするの?

How can i redirect from one function to another function in the same controller?
4

2 に答える 2

8

フロントエンド コントローラーで使用できるリダイレクト機能は次の 3 つです。

_redirect()
_redirectUrl()
_redirectReferer()

_redirect('frontName/controllerName/actionName/param1/param2')内部リダイレクトに使用されます。
_redirectUrl($fullUrl)外部リダイレクトに使用されます。
_redirectReferer()リファラー URL にリダイレクトするために使用されます。

これがより多くの情報を提供することを願っています。

于 2012-08-07T10:10:28.677 に答える
1

このようなものをtest1アクションに入れることができます。

$this->_redirect('*/*/test2', array(if you want to pass something then from here you can pass ));
于 2012-08-07T10:02:58.700 に答える