function execute() { if (ConnectionHelper::isLogin()) { Request::redirect('/profile/'); } $this->setSeoPage('registration'); if (!Request::post('registration')) { return; } $model = new connectionUserModel(); $registration = $model->registration(array('first_name' => Request::post('first_name'), 'last_name' => Request::post('last_name'), 'email' => Request::post('email'), 'password' => Request::post('password'), 'sex' => Request::post('sex'), 'birth_day' => (int) Request::post('birth_day'), 'birth_month' => (int) Request::post('birth_month'), 'birth_year' => (int) Request::post('birth_year'), 'country' => (int) Request::post('country'))); $status = 'error'; $message = '[`Title success registration`]'; if ($registration) { $status = 'success'; } else { $message = '[`Title error in registration`]'; } echo json_encode(array('status' => $status, 'message' => $message)); $this->endAction(); }