The packages used:

  • Lithium is a RAD (Rapid Application Development)
  • MongoDB is a NoSQL DB

1. Lithium

You can download and install lithium from Lithium

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?php
namespace app\controllers;
use app\models\Users;
use lithium\security\Auth;
use lithium\storage\Session;
 
class UsersController extends \lithium\action\Controller {
 
public function index(){
$users = Users::all();
return compact('users');
}
public function signup() {
$user = Users::create();
if(($this->request->data) && $user->save($this->request->data)) {
$this->redirect('Users::index');
}
return compact(array('user'));
}
public function login() {
if ($this->request->data && Auth::check('member', $this->request)) {
return $this->redirect('Users::index');
}
}
public function logout() {
Auth::clear('member');
return $this->redirect('Users::index');
}
}
?>
view raw UsersController.php hosted with ❤ by GitHub