Packages

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

Classes

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (https://nette.org)
 5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 6:  * @package Nette\Application\Responses
 7:  */
 8: 
 9: 
10: 
11: /**
12:  * String output response.
13:  *
14:  * @author     David Grudl
15:  *
16:  * @property-read mixed $source
17:  * @package Nette\Application\Responses
18:  */
19: class NTextResponse extends NObject implements IPresenterResponse
20: {
21:     /** @var mixed */
22:     private $source;
23: 
24: 
25:     /**
26:      * @param  mixed  renderable variable
27:      */
28:     public function __construct($source)
29:     {
30:         $this->source = $source;
31:     }
32: 
33: 
34:     /**
35:      * @return mixed
36:      */
37:     public function getSource()
38:     {
39:         return $this->source;
40:     }
41: 
42: 
43:     /**
44:      * Sends response to output.
45:      * @return void
46:      */
47:     public function send(IHttpRequest $httpRequest, IHttpResponse $httpResponse)
48:     {
49:         if ($this->source instanceof ITemplate) {
50:             $this->source->render();
51: 
52:         } else {
53:             echo $this->source;
54:         }
55:     }
56: 
57: }
58: 
Nette Framework 2.0.18 (for PHP 5.2, prefixed) API documentation generated by ApiGen 2.8.0