public function renderWidget(\Twig_Environment $env, PagePartAdmin $ppAdmin, $form = null, array $parameters = [], $templateName = null)
    {
        if ($templateName === null) {
            $templateName = 'KunstmaanPagePartBundle:PagePartAdminTwigExtension:widget.html.twig';
        }

        $template = $env->loadTemplate($templateName);

        return $template->render(array_merge($parameters, [
            'pagepartadmin' => $ppAdmin,
            'page' => $ppAdmin->getPage(),
            'form' => $form,
            'extended' => $this->usesExtendedPagePartChooser,
        ]));
    }