access = new Access(); } public function index() { // echo "This is index of home"; // Nanti di replace sama twig view ke App\Views\Data\pengumuman.html $posts = new Posts(); $posts->index(); return true; } public function login() { // echo "You have to login"; // Nanti di replace sama twig view ke App\Views\Access\login.html View::render('Access/login.html', [ 'token' => Token::generate() ]); return true; } public function put($args = []) { if ($this->access->login($args)) { $table = 'user'; $id = Session::get('userid'); if ($this->access->update($table, ['status' => 1], $id)) { Redirect::to('/'); } } } public function logout() { if ($this->access->logout()) { Redirect::to('/'); } } }