original_string: public function newAction(Request $request)
      {
          $acl = $this->get('bacon_acl.service.authorization');
  
          if (!$acl->authorize('module', 'NEW')) {
              throw $this->createAccessDeniedException();
          }
  
          $breadcumbs = $this->container->get('bacon_breadcrumbs');
  
          $breadcumbs->addItem([
              'title' => 'Module',
              'route' => 'module',
          ]);
  
          $breadcumbs->addItem([
              'title' => 'New',
              'route' => '',
          ]);
  
          $form = $this->createForm(ModuleFormType::class, new Module());
  
          $form->handleRequest($request);
  
          if ($form->isSubmitted()) {
              $handler = new ModuleFormHandler(
                  $form,
                  $this->getDoctrine()->getManager(),
                  $this->get('session')->getFlashBag()
              );
  
              if ($handler->save()) {
                  return $this->redirect($this->generateUrl('module'));
              }
          }
  
          return [
              'form'   => $form->createView(),
          ];
      }
code: public function newAction(Request $request)
      {
          $acl = $this->get('bacon_acl.service.authorization');
  
          if (!$acl->authorize('module', 'NEW')) {
              throw $this->createAccessDeniedException();
          }
  
          $breadcumbs = $this->container->get('bacon_breadcrumbs');
  
          $breadcumbs->addItem([
              'title' => 'Module',
              'route' => 'module',
          ]);
  
          $breadcumbs->addItem([
              'title' => 'New',
              'route' => '',
          ]);
  
          $form = $this->createForm(ModuleFormType::class, new Module());
  
          $form->handleRequest($request);
  
          if ($form->isSubmitted()) {
              $handler = new ModuleFormHandler(
                  $form,
                  $this->getDoctrine()->getManager(),
                  $this->get('session')->getFlashBag()
              );
  
              if ($handler->save()) {
                  return $this->redirect($this->generateUrl('module'));
              }
          }
  
          return [
              'form'   => $form->createView(),
          ];
      }
code_tokens: public function newAction ( Request $ request ) { $ acl = $ this -> get ( 'bacon_acl.service.authorization' ) ; if ( ! $ acl -> authorize ( 'module' , 'NEW' ) ) { throw $ this -> createAccessDeniedException ( ) ; } $ breadcumbs = $ this -> container -> get ( 'bacon_breadcrumbs' ) ; $ breadcumbs -> addItem ( [ 'title' => 'Module' , 'route' => 'module' , ] ) ; $ breadcumbs -> addItem ( [ 'title' => 'New' , 'route' => '' , ] ) ; $ form = $ this -> createForm ( ModuleFormType :: class , new Module ( ) ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) ) { $ handler = new ModuleFormHandler ( $ form , $ this -> getDoctrine ( ) -> getManager ( ) , $ this -> get ( 'session' ) -> getFlashBag ( ) ) ; if ( $ handler -> save ( ) ) { return $ this -> redirect ( $ this -> generateUrl ( 'module' ) ) ; } } return [ 'form' => $ form -> createView ( ) , ] ; }
docstring: Displays a form to create a new Module entity.
  
  @Route("/new", name="module_new")
  @Method({"GET", "POST"})
  @Security("has_role('ROLE_ADMIN')")
  @Template()
docstring_tokens: Displays a form to create a new Module entity .