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