public function getViewPath($view)
    {
        if ($this->finder) {
            if (file_exists($file = $this->finder->find($view))) {
                return $file;
            }
        }

        if (file_exists($view)) {
            return $view;
        } elseif (file_exists($view . '.' . $this->extension)) {
            return $view . '.' . $this->extension;
        }

        foreach ($this->viewPaths as $viewPath) {
            if (file_exists($viewPath . '/' . $view . '.' . $this->extension)) {
                return $viewPath . '/' . $view . '.' . $this->extension;
            }
        }

        return null;
    }