/Nette/Application/Responses/RenderResponse.php
PHP | 78 lines | 23 code | 20 blank | 35 comment | 2 complexity | cab8c0d66a7cf7b7d9d1783c5bed3623 MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- /**
- * Nette Framework
- *
- * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- *
- * This source file is subject to the "Nette license" that is bundled
- * with this package in the file license.txt.
- *
- * For more information please see http://nettephp.com
- *
- * @copyright Copyright (c) 2004, 2009 David Grudl
- * @license http://nettephp.com/license Nette license
- * @link http://nettephp.com
- * @category Nette
- * @package Nette\Application
- */
- /*namespace Nette\Application;*/
- require_once dirname(__FILE__) . '/../../Object.php';
- require_once dirname(__FILE__) . '/../../Application/IPresenterResponse.php';
- /**
- * Rendering presenter response.
- *
- * @author David Grudl
- * @copyright Copyright (c) 2004, 2009 David Grudl
- * @package Nette\Application
- */
- class RenderResponse extends /*Nette\*/Object implements IPresenterResponse
- {
- /** @var mixed */
- private $source;
- /**
- * @param mixed renderable variable
- */
- public function __construct($source)
- {
- $this->source = $source;
- }
- /**
- * @return mixed
- */
- final public function getSource()
- {
- return $this->source;
- }
- /**
- * Sends response to output.
- * @return void
- */
- public function send()
- {
- if ($this->source instanceof /*Nette\Templates\*/ITemplate) {
- $this->source->render();
- } else {
- echo $this->source;
- }
- }
- }