[Ivan Diaz] - Add signup controller
This commit is contained in:
parent
18d0818806
commit
400de7e480
|
@ -3,7 +3,6 @@
|
||||||
class LoginController extends Controller {
|
class LoginController extends Controller {
|
||||||
const PATH = '/login';
|
const PATH = '/login';
|
||||||
|
|
||||||
|
|
||||||
public function handler() {
|
public function handler() {
|
||||||
$email = Controller::request('email');
|
$email = Controller::request('email');
|
||||||
$password = Controller::request('password');
|
$password = Controller::request('password');
|
||||||
|
@ -20,4 +19,4 @@ class LoginController extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$controllerGroup->addController(new LoginController());
|
$controllerGroup->addController(new LoginController);
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
/*$controllerGroup->addController('/signup', function () {
|
|
||||||
$email = Controller::request('email');
|
|
||||||
$password = Controller::request('password');
|
|
||||||
|
|
||||||
$userInstance = new User();
|
class SignUpController extends Controller {
|
||||||
$userInstance->setProperties(array(
|
const PATH = '/signup';
|
||||||
'email' => $email,
|
|
||||||
'password' => $password,
|
|
||||||
'admin' => 0
|
|
||||||
));
|
|
||||||
$id = $userInstance->store();
|
|
||||||
|
|
||||||
Response::respondSuccess(array(
|
public function handler() {
|
||||||
'id' => $id
|
$email = Controller::request('email');
|
||||||
));
|
$password = Controller::request('password');
|
||||||
});
|
|
||||||
*/
|
$userInstance = new User();
|
||||||
|
$userInstance->setProperties(array(
|
||||||
|
'email' => $email,
|
||||||
|
'password' => $password,
|
||||||
|
'admin' => 0
|
||||||
|
));
|
||||||
|
$id = $userInstance->store();
|
||||||
|
|
||||||
|
Response::respondSuccess(array(
|
||||||
|
'id' => $id
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$controllerGroup->addController(new SignUpController);
|
Loading…
Reference in New Issue