protected function render($template, array $vars = [])
    {
        $pluginTemplateFolder = $this->plugin->getTemplateFolder();
        if (!empty($pluginTemplateFolder)) {
            $loader = new \Twig_Loader_Filesystem($pluginTemplateFolder);
            $this->app['twig']->getLoader()->addLoader($loader);
        }

        $defaults = [
            'layout' => [
                'title' => preg_replace('/\\.[^.\\s]{3,4}$/', '', $template)
            ]
        ];
        $vars = array_replace_recursive($defaults, $vars);

        return $this->app['twig']->render($template, $vars);
    }