Welcome Guest, Not a member yet? Register   Sign In
help with boolean
#5

[eluser]n0xie[/eluser]
[quote author="KrizzAngel" date="1264174356"]
does this mean that if the checker returns true it will continue to load the home page?? what if its false..
[/quote]
No it will just return TRUE or FALSE. Since you don't actually do anything with the function, the return value gets lost.

Quote:how can i express the other code so that it will load another page if its false/

Try this:
Code:
function index(){
  if($this->checker()) {
    $this->load->view('someview');
  }
  else
  {
    $this->load->view('someotherview');
  }
}

function checker(){
     return (bool) $this->session->userdata('is_logged_in');
}


Messages In This Thread
help with boolean - by El Forum - 01-21-2010, 09:13 PM
help with boolean - by El Forum - 01-21-2010, 11:04 PM
help with boolean - by El Forum - 01-22-2010, 02:01 AM
help with boolean - by El Forum - 01-22-2010, 03:32 AM
help with boolean - by El Forum - 01-22-2010, 03:51 AM
help with boolean - by El Forum - 01-22-2010, 05:30 AM
help with boolean - by El Forum - 01-22-2010, 07:04 AM
help with boolean - by El Forum - 01-22-2010, 07:14 AM
help with boolean - by El Forum - 01-22-2010, 10:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB