From bd8c5a511a9eb364629b725eb08ea52f881feffb Mon Sep 17 00:00:00 2001 From: Sotaro KARASAWA Date: Wed, 24 Jun 2009 01:47:34 +0900 Subject: [PATCH] =?utf8?q?redirect=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?utf8?q?=E3=81=AB=E3=80=81HTTP=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF?= =?utf8?q?=E3=82=B9=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=8C=87=E5=AE=9A?= =?utf8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?utf8?q?=E3=83=B3=E5=A4=89=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit デフォルトは302です --- CHANGES | 4 ++++ class/Ethna_ViewClass.php | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 4e8226b..54f92cc 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ ** 2.5.0-preview6 +*** features + +- Ethna_ViewClass#redirect にて、リダイレクト用HTTPステータスコードが302で固定だったので、オプション引数として変更可能とした + *** bug fix - ethna make-plugin-package のデフォルトインストールディレクトリが誤っていたバグを修正 diff --git a/class/Ethna_ViewClass.php b/class/Ethna_ViewClass.php index 2d5961f..9c5ff74 100644 --- a/class/Ethna_ViewClass.php +++ b/class/Ethna_ViewClass.php @@ -276,20 +276,20 @@ class Ethna_ViewClass // {{{ redirect /** - * HTTPヘッダを送信します。 + * リダイレクト処理 + * - デフォルトのヘッダを送信しない + * - レイアウトテンプレートの使用をしない * - * @param mixed ヘッダを設定する値 - * 配列指定の場合、header => value の形式 - * 整数指定の場合は、HTTPステータスコード - * 文字列で指定する場合は、ヘッダ出力をそのまま指定 + * @param string リダイレクト先(URL) + * @param int HTTPステータスコード (3xx) * @access public */ - function redirect($url) + function redirect($url, $staus_code = 302) { $this->has_default_header = false; $this->use_layout = false; - $this->header(302); + $this->header($staus_code); $this->header(array('Location' => $url)); } // }}} -- 2.11.0