src/View/Helper/Alert.php
public function end()
    {
        if (!$this->captureLock) {
            throw new \RuntimeException('Cannot end capture, there is no capture running.');
        }

        $type                 = $this->captureType;
        $content              = ob_get_clean();
        $options              = $this->captureOptions;
        $this->captureLock    = false;
        $this->captureType    = null;
        $this->captureOptions = null;

        return $this->render($type, $content, $options);
    }
public function end()
    {
        if (!$this->captureLock) {
            throw new \RuntimeException('Cannot end capture, there is no capture running.');
        }

        $type                 = $this->captureType;
        $content              = ob_get_clean();
        $options              = $this->captureOptions;
        $this->captureLock    = false;
        $this->captureType    = null;
        $this->captureOptions = null;

        return $this->render($type, $content, $options);
    }
Ends content capturing and returns the captured content.

@throws \RuntimeException if there's no capturing process running
@return string
@uses render()