public function saveAction(Request $request)
    {
        $repository = $this->get('phlexible_media_template.template_manager');

        $templateKey = $request->get('template_key');
        $params = $request->request->all();

        unset($params['template_key'],
        $params['module'],
        $params['controller'],
        $params['action']);

        $template = $repository->find($templateKey);

        $params = $this->fixParams($params);

        foreach ($params as $key => $value) {
            $template->setParameter($key, $value);
        }

        $repository->updateTemplate($template);

        return new ResultResponse(true, 'Media template "'.$template->getKey().'" saved.');
    }
public function saveAction(Request $request)
    {
        $repository = $this->get('phlexible_media_template.template_manager');

        $templateKey = $request->get('template_key');
        $params = $request->request->all();

        unset($params['template_key'],
        $params['module'],
        $params['controller'],
        $params['action']);

        $template = $repository->find($templateKey);

        $params = $this->fixParams($params);

        foreach ($params as $key => $value) {
            $template->setParameter($key, $value);
        }

        $repository->updateTemplate($template);

        return new ResultResponse(true, 'Media template "'.$template->getKey().'" saved.');
    }
public function saveAction ( Request $ request ) { $ repository = $ this -> get ( 'phlexible_media_template.template_manager' ) ; $ templateKey = $ request -> get ( 'template_key' ) ; $ params = $ request -> request -> all ( ) ; unset ( $ params [ 'template_key' ] , $ params [ 'module' ] , $ params [ 'controller' ] , $ params [ 'action' ] ) ; $ template = $ repository -> find ( $ templateKey ) ; $ params = $ this -> fixParams ( $ params ) ; foreach ( $ params as $ key => $ value ) { $ template -> setParameter ( $ key , $ value ) ; } $ repository -> updateTemplate ( $ template ) ; return new ResultResponse ( true , 'Media template "' . $ template -> getKey ( ) . '" saved.' ) ; }
Save variables.

@param Request $request

@return ResultResponse
@Route("/save", name="mediatemplates_form_save")
Save variables .