public function actionRegister($register = null) { if (null !== $register) { try { $identity = new Identity(); $user = $identity->register($register); $identity->login($user); $this->app->flash->message = 'Добро пожаловать, ' . $user->email . '!'; $this->redirect('/'); } catch (\App\Components\Auth\MultiException $e) { $this->data->errors = $e; } $this->data->email = $register->email; } }
public function actionRegister($customer = null, $do = true) { if ($customer !== null) { try { $role = Role::findAllByName('customer'); $identity = new Identity(); $user = $identity->register($customer, $role); $identity->login($user); $this->app->flash->message = 'Welcome to hell'; $this->redirect('/sales/categories'); } catch (\App\Components\Auth\MultiException $e) { $this->data->errors = $e; } $this->data->email = $customer->email; $this->data->password = $customer->password; $this->data->password2 = $customer->password2; $this->data->firstname = $customer->firstname; $this->data->lastname = $customer->lastname; $this->data->phonenum = $customer->phonenum; } }