ManaPHP\Renderer::stopSection PHP Method

stopSection() public method

Stop injecting content into a section.
public stopSection ( boolean $overwrite = false ) : void
$overwrite boolean
return void
    public function stopSection($overwrite = false)
    {
        if (count($this->_sectionStack) === 0) {
            throw new RendererException('cannot stop a section without first starting session');
        }
        $last = array_pop($this->_sectionStack);
        if ($overwrite || !isset($this->_sections[$last])) {
            $this->_sections[$last] = ob_get_clean();
        } else {
            $this->_sections[$last] .= ob_get_clean();
        }
    }