private function doRender($path, array $data = [], $class = null)
    {
        $status = $this->status();
        if ($status === self::STATUS_IDLE) {
            $this->statusTransitions();
        } elseif ($status & self::STATUS_IDLE) {
            $this->status = self::STATUS_IN_LAYOUT;
        }
        $template = $this->stack()->factory($path, $this, $class);
        $this->events->fire('f.template.render', $template, $data);
        $output = $template->render($data);
        $this->events->fire('f.template.renderered', $template, $output, $this->status);

        return $output;
    }