Packages

  • Nette
    • Application
      • Application\Diagnostics
      • Application\Responses
      • Application\Routers
      • Application\UI
    • Caching
      • Caching\Storages
    • ComponentModel
    • Config
    • Database
      • Database\Diagnostics
      • Database\Drivers
      • Database\Reflection
      • Database\Table
    • DI
    • Diagnostics
    • Forms
      • Forms\Controls
      • Forms\Rendering
    • Http
    • Iterators
    • Latte
      • Latte\Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • None
  • PHP

Classes

  • FileResponse
  • ForwardResponse
  • JsonResponse
  • RedirectResponse
  • TextResponse
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  *
 6:  * Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com)
 7:  *
 8:  * For the full copyright and license information, please view
 9:  * the file license.txt that was distributed with this source code.
10:  * @package Nette\Application\Responses
11:  */
12: 
13: 
14: 
15: /**
16:  * Redirects to new URI.
17:  *
18:  * @author     David Grudl
19:  * @package Nette\Application\Responses
20:  */
21: class RedirectResponse extends Object implements IPresenterResponse
22: {
23:     /** @var string */
24:     private $url;
25: 
26:     /** @var int */
27:     private $code;
28: 
29: 
30: 
31:     /**
32:      * @param  string  URI
33:      * @param  int     HTTP code 3xx
34:      */
35:     public function __construct($url, $code = IHttpResponse::S302_FOUND)
36:     {
37:         $this->url = (string) $url;
38:         $this->code = (int) $code;
39:     }
40: 
41: 
42: 
43:     /**
44:      * @return string
45:      */
46:     final public function getUrl()
47:     {
48:         return $this->url;
49:     }
50: 
51: 
52: 
53:     /**
54:      * @return int
55:      */
56:     final public function getCode()
57:     {
58:         return $this->code;
59:     }
60: 
61: 
62: 
63:     /**
64:      * Sends response to output.
65:      * @return void
66:      */
67:     public function send(IHttpRequest $httpRequest, IHttpResponse $httpResponse)
68:     {
69:         $httpResponse->redirect($this->url, $this->code);
70:     }
71: 
72: }
73: 
Nette Framework 2.0beta1 (for PHP 5.2) API API documentation generated by ApiGen 2.3.0