private function locateTemplate()
    {
        foreach ($this->bundles as $bundleName) {
            $templateName = "{$bundleName}:{$this->templatePath}";

            if ($this->engine->exists($templateName)) {
                return $templateName;
            }
        }

        throw new RuntimeException(sprintf(
            'Template "%s" not found',
            $this->templatePath
        ));
    }