public function wrapTemplateAction($module)
    {
        if ($this->getModuleSetting($module, 'type') !== 'template') {
            throw new BadRequestHttpException($module . ' is not declared as a template');
        }
        $path = $this->getModuleSetting($module, 'path');
        $response = new Response();

        return $this->render('eZPlatformUIBundle:Template:wraptemplate.js.twig', [
            'path' => $path,
            'module' => $module,
            'templateCode' => file_get_contents($path),
        ], $response);
    }