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:  * String output response.
17:  *
18:  * @author     David Grudl
19:  * @package Nette\Application\Responses
20:  */
21: class TextResponse extends Object implements IPresenterResponse
22: {
23:     /** @var mixed */
24:     private $source;
25: 
26: 
27: 
28:     /**
29:      * @param  mixed  renderable variable
30:      */
31:     public function __construct($source)
32:     {
33:         $this->source = $source;
34:     }
35: 
36: 
37: 
38:     /**
39:      * @return mixed
40:      */
41:     final public function getSource()
42:     {
43:         return $this->source;
44:     }
45: 
46: 
47: 
48:     /**
49:      * Sends response to output.
50:      * @return void
51:      */
52:     public function send(IHttpRequest $httpRequest, IHttpResponse $httpResponse)
53:     {
54:         if ($this->source instanceof ITemplate) {
55:             $this->source->render();
56: 
57:         } else {
58:             echo $this->source;
59:         }
60:     }
61: 
62: }
63: 
Nette Framework 2.0beta1 (for PHP 5.2) API API documentation generated by ApiGen 2.3.0