private function getContent($file, $data = [])
    {
        $path = fixPath($file);
        if (file_exists($path)) {
            ob_start();
            //Extract variables
            extract($data);

            /** @noinspection PhpIncludeInspection */
            require $path;

            return ob_get_clean();
        } else {
            throw new Exception("View $path not found");
        }
    }