From c43b4744dbc3090f992d5ba688ba0ae774bfac7c Mon Sep 17 00:00:00 2001 From: Gregorio Chiko Putra Date: Wed, 6 Sep 2017 14:53:22 +0700 Subject: [PATCH] Cannot register empty data --- App/Controllers/Home.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/App/Controllers/Home.php b/App/Controllers/Home.php index b5d1635..0062eff 100644 --- a/App/Controllers/Home.php +++ b/App/Controllers/Home.php @@ -49,6 +49,14 @@ class Home // Methods public function post($args = []) { + foreach ($args as $value) { + if ($value == '') { + Session::flash('info', 'All data must not be empty'); + Redirect::to('/'); + die(); + } + } + $table = 'user'; $date = new \DateTime(); @@ -65,7 +73,7 @@ class Home $this->access->entry($table, $args); - // Redirect::to('/'); + Redirect::to('/'); } public function put($args = [])