portapipe / Login-GroceryCrud

A Login/Logout system for GroceryCrud (codeigniter).
32 stars 26 forks source link

Advanced tools isLogged() question #2

Closed cwkean87 closed 7 years ago

cwkean87 commented 7 years ago

hi there, is me again. For the isLogged() method, i used the code provided as below if($this->login_model->isLogged()){ $name = $this->login_model->name(); echo "HI $name! You are Logged IN!"; }else{ redirect("/login"); }

but it does not work. Then it works after i modified the lower case 'l' in login_model like below if($this->Login_model->isLogged()){ $name = $this->Login_model->name(); echo "HI $name! You are Logged IN!"; }else{ redirect("/login"); }

is that a bug or i did something wrong in the config?

p/s: i did not modify any of the 3 files you provide.

cheers

portapipe commented 7 years ago

That's very odd... the code is fine, I've wrote lots of functions using the login_model string, maybe it's something related the CI version you're using (?)

cwkean87 commented 7 years ago

i am using the latest version 3.1.0. But no worry, just to give you a heads up on this matter. Everything works fine for now. Cheers

portapipe commented 7 years ago

I think I get why you get this problem. In the main page there is a model inclusion: load("Login_model") with capital L, that's the step that stopped you. Just fix that and you'll be fine. Lowercase l.

cwkean87 commented 7 years ago

Hi, yes you're right. Issue fix. Thank you for your support. Cheers.