ログイン後に前のページにリダイレクトしたい。私の最初の質問は、それに対する最善の解決策は何ですか?
次の解決策を試します。get リクエストで前のページの URL を送信し、get リクエストで指定された URL にリダイレクトします。
これは私の前のページのアクションです。
public function executeVotes(sfWebRequest $request)
{
$chaletId = (int) $request->getParameter('id');
$this->rates = (int) $request->getParameter('rates', 0);
if (
($this->getUser()->isAuthenticated() === FALSE )
|| ($this->getUser()->hasCredential('member_permission') === FALSE)
) {
$this->redirect('member_signin', array(
'redirect' => $this->getController()->genUrl('chalet_votes/' . $chaletId . '/?rates=' . $this->rates, true)
));
}
}
これは私のサインイン アクションです
public function executeSignin(sfWebRequest $request)
{
$this->redirectUrl = $this->getRequest()->getParameter('redirect');
echo $this->redirectUrl; die;
}
これは、これらのアクションのルーターです。
member_signin:
url: /member/login/*
param: { module: member, action: signin}
votes:
url: /chalet/votes/:id
param: { module: test, action: votes }
これは、サインイン ページにリダイレクトした後の URL です。
http://test.dev/member/login/redirect/http%3A%2F%2Fchalet.dev%2Fchalet_votes%2F1%2Frates%2F9
私のサーバーは 404 ページ エラーを表示します。どうした?どうすればできますか?