<?php
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage main
 * @copyright 2001-2012 Bitrix
 */
namespace Bitrix\Main;

abstract class Page
{
	/** @var \Bitrix\Main\Application */
	protected $application;

	protected $title;

	public function __construct(Application $application)
	{
		$this->application = $application;
	}

	protected function initializeCulture()
	{
	}

	public function setTitle($title)
	{
		$this->title = $title;
	}

	public function startRequest()
	{
		ob_start();
	}

	public function render()
	{
		$text = ob_get_clean();
		return /*$this->title."<br>".*/$text/*."<br>"*/;
	}

	/**
	 * @return Context
	 */
	public function getContext()
	{
		return $this->application->getContext();
	}

	/**
	 * @return Request
	 */
	public function getRequest()
	{
		$context = $this->application->getContext();
		return $context->getRequest();
	}

	/**
	 * @return Response
	 */
	public function getResponse()
	{
		$context = $this->application->getContext();
		return $context->getResponse();
	}
 }
