Bundle/BlogBundle/Controller/BlogController.php
public function settingsAction(Request $request, BasePage $blog)
    {
        $form = $this->getSettingsForm($blog);

        $form->handleRequest($request);
        if ($request->isMethod('POST')) {
            if ($form->isValid()) {
                $this->getDoctrine()->getManager()->flush();
                $form = $this->getSettingsForm($blog);
            } else {
                $this->warn('error_occured');
            }
        }

        return $this->render(
            'VictoireBlogBundle:Blog/Tabs:_settings.html.twig',
            [
                'blog'               => $blog,
                'form'               => $form->createView(),
                'businessProperties' => [],
            ],
            new Response(null, 200, [
                'X-Inject-Alertify' => true,
            ])
        );
    }
public function settingsAction(Request $request, BasePage $blog)
    {
        $form = $this->getSettingsForm($blog);

        $form->handleRequest($request);
        if ($request->isMethod('POST')) {
            if ($form->isValid()) {
                $this->getDoctrine()->getManager()->flush();
                $form = $this->getSettingsForm($blog);
            } else {
                $this->warn('error_occured');
            }
        }

        return $this->render(
            'VictoireBlogBundle:Blog/Tabs:_settings.html.twig',
            [
                'blog'               => $blog,
                'form'               => $form->createView(),
                'businessProperties' => [],
            ],
            new Response(null, 200, [
                'X-Inject-Alertify' => true,
            ])
        );
    }
public function settingsAction ( Request $ request , BasePage $ blog ) { $ form = $ this -> getSettingsForm ( $ blog ) ; $ form -> handleRequest ( $ request ) ; if ( $ request -> isMethod ( 'POST' ) ) { if ( $ form -> isValid ( ) ) { $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; $ form = $ this -> getSettingsForm ( $ blog ) ; } else { $ this -> warn ( 'error_occured' ) ; } } return $ this -> render ( 'VictoireBlogBundle:Blog/Tabs:_settings.html.twig' , [ 'blog' => $ blog , 'form' => $ form -> createView ( ) , 'businessProperties' => [ ] , ] , new Response ( null , 200 , [ 'X-Inject-Alertify' => true , ] ) ) ; }
Display a form to edit Blog settings.

@param Request  $request
@param BasePage $blog

@Route("/{id}/settings", name="victoire_blog_settings")
@Method(methods={"GET", "POST"})
@ParamConverter("blog", class="VictoirePageBundle:BasePage")

@throws \InvalidArgumentException

@return Response
Display a form to edit Blog settings .