Example #1
0
 /**
  * @Route("/account/create", name="account_create", options={"expose"=true})
  * @Method("GET")
  */
 public function createAction()
 {
     $customer = new AccountData();
     $customer->setLocale($this->getRequest()->getLocale());
     if ($facebookSession = $this->getRequest()->getSession()->get('facebook.session')) {
         if (isset($facebookSession['first_name']) && $facebookSession['first_name']) {
             $customer->setFirstName($facebookSession['first_name']);
         }
         if (isset($facebookSession['last_name']) && $facebookSession['last_name']) {
             $customer->setLastName($facebookSession['last_name']);
         }
         if (isset($facebookSession['email']) && $facebookSession['email']) {
             $customer->setEmail($facebookSession['email']);
         }
     }
     $newAccountData = new NewAccountData();
     $newAccountData->setCustomer($customer);
     $newAccountForm = $this->container->get('form.factory')->create(new NewAccountType(), $newAccountData);
     $parameters = array('newAccountForm' => $newAccountForm->createView(), 'bundle' => in_array($this->get('kernel')->getEnvironment(), array('mobile', 'mobile_dev')) ? 'MobileBundle' : 'SehBundle');
     return $this->render('SehBundle:account:create/base.html.twig', $parameters);
 }