src/Slashworks/AppBundle/Controller/NotificationCenterController.php
public function indexAction()
        {

            $id = $this->getUser()->getId();

            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

            $form = $this->createFormBuilder($oUser)
                ->setAction($this->generateUrl("notification_center_update"))
                ->add('notification_change', 'checkbox')
                ->add('notification_error', 'checkbox')
                ->add('save', 'submit', array('label' => $this->get('translator')->trans('notificationcenter.form.save')))
                ->getForm();


            return $this->render('SlashworksAppBundle:NotificationCenter:index.html.twig', array(
                'user' => $oUser,
                'form' => $form->createView()
            ));
        }
public function indexAction()
        {

            $id = $this->getUser()->getId();

            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

            $form = $this->createFormBuilder($oUser)
                ->setAction($this->generateUrl("notification_center_update"))
                ->add('notification_change', 'checkbox')
                ->add('notification_error', 'checkbox')
                ->add('save', 'submit', array('label' => $this->get('translator')->trans('notificationcenter.form.save')))
                ->getForm();


            return $this->render('SlashworksAppBundle:NotificationCenter:index.html.twig', array(
                'user' => $oUser,
                'form' => $form->createView()
            ));
        }
public function indexAction ( ) { $ id = $ this -> getUser ( ) -> getId ( ) ; /** @var User $oUser */ $ oUser = UserQuery :: create ( ) -> findOneById ( $ id ) ; $ form = $ this -> createFormBuilder ( $ oUser ) -> setAction ( $ this -> generateUrl ( "notification_center_update" ) ) -> add ( 'notification_change' , 'checkbox' ) -> add ( 'notification_error' , 'checkbox' ) -> add ( 'save' , 'submit' , array ( 'label' => $ this -> get ( 'translator' ) -> trans ( 'notificationcenter.form.save' ) ) ) -> getForm ( ) ; return $ this -> render ( 'SlashworksAppBundle:NotificationCenter:index.html.twig' , array ( 'user' => $ oUser , 'form' => $ form -> createView ( ) ) ) ; }
Display form for notification settings

@return \Symfony\Component\HttpFoundation\Response
Display form for notification settings