public function render($file = '')
    {
        $viewManager = $this->config->get('view_manager');

        if ($viewManager['template_path_stack']) {
            $file = $viewManager['template_path_stack'] . '/' . $file;
        }

        $fileInfo = pathinfo($file);
        if (! isset($fileInfo['extension']) || $fileInfo['extension'] != 'phtml') {
            $file = $file . '.phtml';
        }

        if (is_file($file)) {
            if (! headers_sent()) {
                header('X-Generator: JiNexus Framework');
            }

            ob_start();
            include $file;
            ob_end_flush();
        } else {
            throw new Exception('View not found');
        }
    }