このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| apricot:core:response-class [2020/07/01 13:30] tanaka [RenderResponseクラス] | apricot:core:response-class [2020/07/29 11:34] (現在) tanaka [RedirectResponseクラス] | ||
|---|---|---|---|
| 行 37: | 行 37: | ||
| |hasFlash(string $key): | |hasFlash(string $key): | ||
| |addFlash(string $key, $value): | |addFlash(string $key, $value): | ||
| - | |commit(int $response_code = null)|レスポンスの確定| | + | |commit(int $response_code=null)|レスポンスの確定| | 
| {{fa> | {{fa> | ||
| 行 119: | 行 119: | ||
| * @param int $response_code | * @param int $response_code | ||
| */ | */ | ||
| - | public function commit(int $response_code = null) | + | public function commit(int $response_code=null) | 
| { | { | ||
| // Set Http response code | // Set Http response code | ||
| if (isset($response_code)) | if (isset($response_code)) | ||
| { | { | ||
| - | http_response_code ($response_code); | + | http_response_code($response_code); | 
| } | } | ||
| 行 154: | 行 154: | ||
| |< | |< | ||
| |setHtml(string $html=null): | |setHtml(string $html=null): | ||
| - | |commit(int $response_code = null)|レスポンスの確定| | + | |commit(int $response_code=null)|レスポンスの確定| | 
| {{fa> | {{fa> | ||
| 行 198: | 行 198: | ||
| * @see \Core\Foundation\Response:: | * @see \Core\Foundation\Response:: | ||
| */ | */ | ||
| - | public function commit(int $response_code = null) | + | public function commit(int $response_code=null) | 
| { | { | ||
| // headersに' | // headersに' | ||
| 行 218: | 行 218: | ||
| \\ | \\ | ||
| - | ==== RedirectResponseクラス ==== | + | ===== RedirectResponseクラス | 
| RedirectResponseクラスはResponseクラスから派生したリダイレクト用のクラスです。リダイレクトではフラッシュデータを使ってリダイレクト先のページにデータを送ることが多いので、フラッシュ用のメソッドが追加されています。RedirectResponseクラスは以下のメソッドを持ちます。addHeader()などのResponseクラスのメソッドも使用できます。 | RedirectResponseクラスはResponseクラスから派生したリダイレクト用のクラスです。リダイレクトではフラッシュデータを使ってリダイレクト先のページにデータを送ることが多いので、フラッシュ用のメソッドが追加されています。RedirectResponseクラスは以下のメソッドを持ちます。addHeader()などのResponseクラスのメソッドも使用できます。 | ||