Controller/DefaultController.php
public function editAction($id, Request $request)
    {
        $cm = new CronManager();
        $crons = $cm->get();
        $this->addFlashFromCronManager($cm);
        $form = $this->createCronForm($crons[$id]);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $cm->write();

            $this->addFlashFromCronManager($cm);

            return $this->redirect($this->generateUrl('BCCCronManagerBundle_index'));
        }

        return $this->render('@BCCCronManager:Default:edit.html.twig', array(
            'form'  => $form->createView(),
        ));
    }
public function editAction($id, Request $request)
    {
        $cm = new CronManager();
        $crons = $cm->get();
        $this->addFlashFromCronManager($cm);
        $form = $this->createCronForm($crons[$id]);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $cm->write();

            $this->addFlashFromCronManager($cm);

            return $this->redirect($this->generateUrl('BCCCronManagerBundle_index'));
        }

        return $this->render('@BCCCronManager:Default:edit.html.twig', array(
            'form'  => $form->createView(),
        ));
    }
public function editAction ( $ id , Request $ request ) { $ cm = new CronManager ( ) ; $ crons = $ cm -> get ( ) ; $ this -> addFlashFromCronManager ( $ cm ) ; $ form = $ this -> createCronForm ( $ crons [ $ id ] ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ cm -> write ( ) ; $ this -> addFlashFromCronManager ( $ cm ) ; return $ this -> redirect ( $ this -> generateUrl ( 'BCCCronManagerBundle_index' ) ) ; } return $ this -> render ( '@BCCCronManager:Default:edit.html.twig' , array ( 'form' => $ form -> createView ( ) , ) ) ; }
Edit a cron

@param $id int The line of the cron in the cron table
@param Request $request

@return RedirectResponse|Response
Edit a cron