Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • FileResponse
  • ForwardResponse
  • JsonResponse
  • RedirectResponse
  • TextResponse
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Application\Responses;
 9: 
10: use Nette;
11: use Nette\Http;
12: 
13: 
14: /**
15:  * Redirects to new URI.
16:  *
17:  * @property-read string $url
18:  * @property-read int $code
19:  */
20: class RedirectResponse extends Nette\Object implements Nette\Application\IResponse
21: {
22:     /** @var string */
23:     private $url;
24: 
25:     /** @var int */
26:     private $code;
27: 
28: 
29:     /**
30:      * @param  string  URI
31:      * @param  int     HTTP code 3xx
32:      */
33:     public function __construct($url, $code = Http\IResponse::S302_FOUND)
34:     {
35:         $this->url = (string) $url;
36:         $this->code = (int) $code;
37:     }
38: 
39: 
40:     /**
41:      * @return string
42:      */
43:     public function getUrl()
44:     {
45:         return $this->url;
46:     }
47: 
48: 
49:     /**
50:      * @return int
51:      */
52:     public function getCode()
53:     {
54:         return $this->code;
55:     }
56: 
57: 
58:     /**
59:      * Sends response to output.
60:      * @return void
61:      */
62:     public function send(Http\IRequest $httpRequest, Http\IResponse $httpResponse)
63:     {
64:         $httpResponse->redirect($this->url, $this->code);
65:     }
66: 
67: }
68: 
Nette 2.3.4 API API documentation generated by ApiGen 2.8.0