public function initAction(Request $request, $templateType, $contentType, $contentId = null)
    {
        $templateDomain = $this->container->get('synapse.template.domain');

        $template = empty($contentId)
            ? $templateDomain->createGlobal(
                $contentType,
                $templateType
            )
            : $templateDomain->createLocal(
                $this->container->get('synapse.content.resolver')->resolveContentId($contentType, $contentId),
                $templateType
            )
        ;

        return new RedirectResponse(empty($contentId)
            ? $this->container->get('router')->generate('synapse_admin_template_edition', array(
                'id' => $template->getId(),
            ))
            : $request->server->get('HTTP_REFERER')
        );
    }
public function initAction(Request $request, $templateType, $contentType, $contentId = null)
    {
        $templateDomain = $this->container->get('synapse.template.domain');

        $template = empty($contentId)
            ? $templateDomain->createGlobal(
                $contentType,
                $templateType
            )
            : $templateDomain->createLocal(
                $this->container->get('synapse.content.resolver')->resolveContentId($contentType, $contentId),
                $templateType
            )
        ;

        return new RedirectResponse(empty($contentId)
            ? $this->container->get('router')->generate('synapse_admin_template_edition', array(
                'id' => $template->getId(),
            ))
            : $request->server->get('HTTP_REFERER')
        );
    }
public function initAction ( Request $ request , $ templateType , $ contentType , $ contentId = null ) { $ templateDomain = $ this -> container -> get ( 'synapse.template.domain' ) ; $ template = empty ( $ contentId ) ? $ templateDomain -> createGlobal ( $ contentType , $ templateType ) : $ templateDomain -> createLocal ( $ this -> container -> get ( 'synapse.content.resolver' ) -> resolveContentId ( $ contentType , $ contentId ) , $ templateType ) ; return new RedirectResponse ( empty ( $ contentId ) ? $ this -> container -> get ( 'router' ) -> generate ( 'synapse_admin_template_edition' , array ( 'id' => $ template -> getId ( ) , ) ) : $ request -> server -> get ( 'HTTP_REFERER' ) ) ; }
Template init action.

@param Request $request
@param string  $templateType
@param string  $contentType
@param int     $contentId

@return Response
Template init action .