public function getFilePath($filename)
    {
        if (!strpos($filename, '.')) {
            $filename .= ".phtml";
        }

        foreach ($this->config->getPaths() as $path) {
            $file = "$path/$filename";

            if (file_exists($file)) {
                return $file;
            }
        }

        throw new FileNotFoundException(
            'File \'' . $filename . '\' was not found.'
        );
    }