public function resolvePath(string $template)
    {
        foreach ($this->basedirs as $basedir) {
            $path = $basedir . self::SEPARATOR . $template . self::SUFFIX;
            $path = str_replace(self::SEPARATOR, DIRECTORY_SEPARATOR, $path);
            if (file_exists($path)) {
                return $path;
            }
        }
        // template not found
        throw new \LogicException('template not found: '.$template);
    }