Bundle/SeoBundle/Controller/PageSeoController.php
public function settingsPostAction(Request $request, View $view)
    {
        $em = $this->getDoctrine()->getManager();

        $pageSeo = $view->getSeo() ?: new PageSeo();
        $form = $this->createSettingsForm($pageSeo, $view);

        $form->handleRequest($request);
        $novalidate = $request->query->get('novalidate', false);

        if (false === $novalidate && $form->isValid()) {
            $em->persist($pageSeo);
            $view->setSeo($pageSeo);
            $em->persist($view);
            $em->flush();

            $this->get('victoire_core.current_view')->setCurrentView($view);
            $this->congrat('victoire_seo.save.success');

            $response = [
                'success' => true,
                'url'     => $this->getViewUrl($view),
            ];
        } else {
            $response = $this->getNotPersistedSettingsResponse($form, $view, $novalidate);
        }

        return new JsonResponse($response);
    }
public function settingsPostAction(Request $request, View $view)
    {
        $em = $this->getDoctrine()->getManager();

        $pageSeo = $view->getSeo() ?: new PageSeo();
        $form = $this->createSettingsForm($pageSeo, $view);

        $form->handleRequest($request);
        $novalidate = $request->query->get('novalidate', false);

        if (false === $novalidate && $form->isValid()) {
            $em->persist($pageSeo);
            $view->setSeo($pageSeo);
            $em->persist($view);
            $em->flush();

            $this->get('victoire_core.current_view')->setCurrentView($view);
            $this->congrat('victoire_seo.save.success');

            $response = [
                'success' => true,
                'url'     => $this->getViewUrl($view),
            ];
        } else {
            $response = $this->getNotPersistedSettingsResponse($form, $view, $novalidate);
        }

        return new JsonResponse($response);
    }
public function settingsPostAction ( Request $ request , View $ view ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ pageSeo = $ view -> getSeo ( ) ? : new PageSeo ( ) ; $ form = $ this -> createSettingsForm ( $ pageSeo , $ view ) ; $ form -> handleRequest ( $ request ) ; $ novalidate = $ request -> query -> get ( 'novalidate' , false ) ; if ( false === $ novalidate && $ form -> isValid ( ) ) { $ em -> persist ( $ pageSeo ) ; $ view -> setSeo ( $ pageSeo ) ; $ em -> persist ( $ view ) ; $ em -> flush ( ) ; $ this -> get ( 'victoire_core.current_view' ) -> setCurrentView ( $ view ) ; $ this -> congrat ( 'victoire_seo.save.success' ) ; $ response = [ 'success' => true , 'url' => $ this -> getViewUrl ( $ view ) , ] ; } else { $ response = $ this -> getNotPersistedSettingsResponse ( $ form , $ view , $ novalidate ) ; } return new JsonResponse ( $ response ) ; }
Save Seo settings.

@param Request $request
@param View    $view

@throws \Exception

@Route("/{id}/settings", name="victoire_seo_pageSeo_settings_post")
@Method("POST")

@return JsonResponse
Save Seo settings .