src/PN/Bundle/CMSBundle/Controller/Administration/FaqController.php
/**
     * Displays a form to edit an existing faq entity.
     *
     * @Route("/{id}/edit", name="faq_edit", methods={"GET", "POST"})
     */
Displays a form to edit an existing faq entity.
Displays a form to edit an existing faq entity .
public function editAction(Request $request, Faq $faq) {
        $editForm = $this->createForm(FaqType::class, $faq);
        $editForm->handleRequest($request);
        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $userName = $this->get('user')->getUserName();
            $faq->setModifiedBy($userName);
            $this->getDoctrine()->getManager()->flush();
            $this->addFlash('success', 'Successfully updated');
            return $this->redirectToRoute('faq_edit', array('id' => $faq->getId()));
        }
        return $this->render('cms/admin/faq/edit.html.twig', array(
                    'faq' => $faq,
                    'edit_form' => $editForm->createView(),
        ));
    }
public function editAction ( Request $ request , Faq $ faq ) { $ editForm = $ this -> createForm ( FaqType :: class , $ faq ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ userName = $ this -> get ( 'user' ) -> getUserName ( ) ; $ faq -> setModifiedBy ( $ userName ) ; $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; $ this -> addFlash ( 'success' , 'Successfully updated' ) ; return $ this -> redirectToRoute ( 'faq_edit' , array ( 'id' => $ faq -> getId ( ) ) ) ; } return $ this -> render ( 'cms/admin/faq/edit.html.twig' , array ( 'faq' => $ faq , 'edit_form' => $ editForm -> createView ( ) , ) ) ; }
Displays a form to edit an existing faq entity.
Displays a form to edit an existing faq entity .