src/app/Controllers/UserController.php
/**
     * The form handler for the signup page.
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     * @param array $args
     * @return ResponseInterface
     */
The form handler for the signup page.
@param ServerRequestInterface $request
@param ResponseInterface $response
@param array $args
@return ResponseInterface
The form handler for the signup page . @param ServerRequestInterface $request @param ResponseInterface $response @param array $args @return ResponseInterface
public function postSignup(ServerRequestInterface $request, ResponseInterface $response, $args)
    {
        $params = $request->getParsedBody();
        $params['last_name'] = isset($params['last_name']) ? $params['last_name'] : null;
        $user = $this->userService->createUser(
            $params['email'],
            $params['first_name'],
            $params['last_name'],
            $params['password']
        );
        return $this->twig->render($response, 'signup_thanks.html', ['user' => $user]);
    }
public function postSignup ( ServerRequestInterface $ request , ResponseInterface $ response , $ args ) { $ params = $ request -> getParsedBody ( ) ; $ params [ 'last_name' ] = isset ( $ params [ 'last_name' ] ) ? $ params [ 'last_name' ] : null ; $ user = $ this -> userService -> createUser ( $ params [ 'email' ] , $ params [ 'first_name' ] , $ params [ 'last_name' ] , $ params [ 'password' ] ) ; return $ this -> twig -> render ( $ response , 'signup_thanks.html' , [ 'user' => $ user ] ) ; }
The form handler for the signup page.
The form handler for the signup page .
// last_name is an optional field // create new user