Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- use Zend\Crypt\Password\Bcrypt;
- public function saveUser(Signup $signup)
- {
- $bcrypt = new Bcrypt();
- $hash = $bcrypt->create(preg_replace('/\s+/', ' ', $signup->password));
- $data = array(
- 'firstname' => preg_replace('/\s+/', ' ', $signup->firstname),
- 'lastname' => preg_replace('/\s+/', ' ', $signup->lastname),
- 'username' => preg_replace('/\s+/', ' ', $signup->username),
- 'password' => $hash,
- 'age' => $signup->age,
- 'imgname' => $signup->fileImg,
- );
- $id = (int)$signup->id;
- if ($id == 0) {
- $this->tableGateway->insert($data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement