1: <?php
2:
3: /**
4: * This file is part of the Nette Framework.
5: *
6: * Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
7: *
8: * This source file is subject to the "Nette license", and/or
9: * GPL license. For more information please see http://nette.org
10: * @package Nette\Application
11: */
12:
13:
14:
15: /**
16: * Rendering presenter response.
17: *
18: * @author David Grudl
19: */
20: class RenderResponse extends Object implements IPresenterResponse
21: {
22: /** @var mixed */
23: private $source;
24:
25:
26:
27: /**
28: * @param mixed renderable variable
29: */
30: public function __construct($source)
31: {
32: $this->source = $source;
33: }
34:
35:
36:
37: /**
38: * @return mixed
39: */
40: final public function getSource()
41: {
42: return $this->source;
43: }
44:
45:
46:
47: /**
48: * Sends response to output.
49: * @return void
50: */
51: public function send()
52: {
53: if ($this->source instanceof ITemplate) {
54: $this->source->render();
55:
56: } else {
57: echo $this->source;
58: }
59: }
60:
61: }
62: