Controller/UserController.php
public function showAction($id)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('users', 'SHOW')) {
            throw $this->createAccessDeniedException();
        }

        $breadcumbs = $this->container->get('bacon_breadcrumbs');

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

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

        $className = $this->getParameter('fos_user.model.user.class');
        
        $entity = $this->getDoctrine()->getRepository($className)->find($id);

        if (!$entity) {

            $this->get('session')->getFlashBag()->add('message', array(
                'type' => 'error',
                'message' => 'The registry not Found',
            ));

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

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }
public function showAction($id)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('users', 'SHOW')) {
            throw $this->createAccessDeniedException();
        }

        $breadcumbs = $this->container->get('bacon_breadcrumbs');

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

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

        $className = $this->getParameter('fos_user.model.user.class');
        
        $entity = $this->getDoctrine()->getRepository($className)->find($id);

        if (!$entity) {

            $this->get('session')->getFlashBag()->add('message', array(
                'type' => 'error',
                'message' => 'The registry not Found',
            ));

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

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }
public function showAction ( $ id ) { $ acl = $ this -> get ( 'bacon_acl.service.authorization' ) ; if ( ! $ acl -> authorize ( 'users' , 'SHOW' ) ) { throw $ this -> createAccessDeniedException ( ) ; } $ breadcumbs = $ this -> container -> get ( 'bacon_breadcrumbs' ) ; $ breadcumbs -> addItem ( array ( 'title' => 'User' , 'route' => 'admin_user' , ) ) ; $ breadcumbs -> addItem ( array ( 'title' => 'Details' , 'route' => '' , ) ) ; $ className = $ this -> getParameter ( 'fos_user.model.user.class' ) ; $ entity = $ this -> getDoctrine ( ) -> getRepository ( $ className ) -> find ( $ id ) ; if ( ! $ entity ) { $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'message' , array ( 'type' => 'error' , 'message' => 'The registry not Found' , ) ) ; return $ this -> redirect ( $ this -> generateUrl ( 'admin_user' ) ) ; } $ deleteForm = $ this -> createDeleteForm ( $ id ) ; return array ( 'entity' => $ entity , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Finds and displays a User entity.

@Route("/{id}", name="admin_user_show")
@Method("GET")
@Security("has_role('ROLE_ADMIN')")
@Template()
Finds and displays a User entity .