Controller/DefaultController.php
public function addAction(Request $request)
    {
        $cm = new CronManager();
        $cron = new Cron();
        $this->addFlashFromCronManager($cm);
        $form = $this->createCronForm($cron);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $cm->add($cron);
            $this->addFlashFromCronManager($cm);

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

        return $this->render('@BCCCronManager:Default:index.html.twig', array(
            'crons' => $cm->get(),
            'raw'   => $cm->getRaw(),
            'form'  => $form->createView(),
        ));
    }
public function addAction(Request $request)
    {
        $cm = new CronManager();
        $cron = new Cron();
        $this->addFlashFromCronManager($cm);
        $form = $this->createCronForm($cron);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $cm->add($cron);
            $this->addFlashFromCronManager($cm);

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

        return $this->render('@BCCCronManager:Default:index.html.twig', array(
            'crons' => $cm->get(),
            'raw'   => $cm->getRaw(),
            'form'  => $form->createView(),
        ));
    }
public function addAction ( Request $ request ) { $ cm = new CronManager ( ) ; $ cron = new Cron ( ) ; $ this -> addFlashFromCronManager ( $ cm ) ; $ form = $ this -> createCronForm ( $ cron ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ cm -> add ( $ cron ) ; $ this -> addFlashFromCronManager ( $ cm ) ; return $ this -> redirect ( $ this -> generateUrl ( 'BCCCronManagerBundle_index' ) ) ; } return $ this -> render ( '@BCCCronManager:Default:index.html.twig' , array ( 'crons' => $ cm -> get ( ) , 'raw' => $ cm -> getRaw ( ) , 'form' => $ form -> createView ( ) , ) ) ; }
Add a cron to the cron table

@param Request $request

@return Response
Add a cron to the cron table