public function render(): string
    {
        $obLevel = ob_get_level();
        ob_start();
        
        extract($this->data);
        
        $templatesPath = $this->config->projectPath . $this->config->templatesPath;
        $package = '';
        $template = $this->template;
        if (!empty($this->section->module)) {
            $package = $this->section->module->vendor . '/' . $this->section->module->name;
        } elseif (!empty($this->widget->vendor)) {
            if (!empty($this->widget->module)) {
                $package = $this->widget->vendor . '/' . $this->widget->module;
                $template = 'widget' . $this->widget->name;
            } else {
                $package = $this->widget->vendor . '/widgets';
                $template = $this->widget->name;
            }
        }
        
        $templatePath = $this->findTemplate($templatesPath, $package, $template);
        if (!file_exists($templatePath)) {
            $templatePath = $this->findTemplate($templatesPath, '', $this->template);
        }
        
        try {
            include $templatePath;
        } catch (\Throwable $e) {
            $this->handleRenderException($e, $obLevel);
        }
        
        return ob_get_clean();
    }