• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/composite/bufferarea.php
  • Класс: BitrixMainCompositeBufferArea
  • Вызов: BufferArea::end
public function end()
{
	if (!$this->started)
	{
		throw new NotSupportedException("begin() has not been called. Frame id: ".$this->getId().".");
	}

	if ($this->ended)
	{
		throw new NotSupportedException("begin() has been called. Frame id: ".$this->getId().".");
	}

	//if beginStub() was called
	if ($this->dynamicPart !== null)
	{
		if ($this->staticPart !== null)
		{
			throw new NotSupportedException("begin() was called with a stub. Frame id: ".$this->getId().".");
		}

		$this->staticPart = ob_get_contents();
		ob_end_clean();
		echo $this->dynamicPart;
	}
	else
	{
		$this->dynamicPart = ob_get_contents();
		if ($this->staticPart === null)
		{
			$this->staticPart = $this->dynamicPart;
		}
		ob_end_flush();
	}

	$this->setStub($this->staticPart);
	$this->finishDynamicArea();

	$this->ended = true;
	return $this;
}