Controller/Backend/LanguageController.php
public function createAction(Request $request)
    {
        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem(array(
            'title' => 'Language',
            'route' => 'admin_language',
        ));

        $breadcumbs->addItem(array(
            'title' => 'New',
            'route' => '',
        ));

        $form = $this->createForm(new LanguageFormType(),new Language());

        $handler = new LanguageFormHandler(
            $form,
            $request,
            $this->getDoctrine()->getManager(),
            $this->get('session')->getFlashBag()
        );

        if ($handler->save()) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return array(
            'form'   => $form->createView(),
        );
    }
public function createAction(Request $request)
    {
        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem(array(
            'title' => 'Language',
            'route' => 'admin_language',
        ));

        $breadcumbs->addItem(array(
            'title' => 'New',
            'route' => '',
        ));

        $form = $this->createForm(new LanguageFormType(),new Language());

        $handler = new LanguageFormHandler(
            $form,
            $request,
            $this->getDoctrine()->getManager(),
            $this->get('session')->getFlashBag()
        );

        if ($handler->save()) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return array(
            'form'   => $form->createView(),
        );
    }
public function createAction ( Request $ request ) { $ breadcumbs = $ this -> container -> get ( 'bacon_breadcrumbs' ) ; $ breadcumbs -> addItem ( array ( 'title' => 'Language' , 'route' => 'admin_language' , ) ) ; $ breadcumbs -> addItem ( array ( 'title' => 'New' , 'route' => '' , ) ) ; $ form = $ this -> createForm ( new LanguageFormType ( ) , new Language ( ) ) ; $ handler = new LanguageFormHandler ( $ form , $ request , $ this -> getDoctrine ( ) -> getManager ( ) , $ this -> get ( 'session' ) -> getFlashBag ( ) ) ; if ( $ handler -> save ( ) ) { return $ this -> redirect ( $ this -> generateUrl ( 'admin_language' ) ) ; } return array ( 'form' => $ form -> createView ( ) , ) ; }
Creates a new Language entity.

@Route("/", name="admin_language_create")
@Method("POST")
@Security("has_role('ROLE_ADMIN')")
@Template("BaconLanguageBundle:Backend/Language:new.html.twig")
Creates a new Language entity .