Welcome Guest, Not a member yet? Register   Sign In
If URI Segment is NULL
#1

[eluser]someone Smile[/eluser]
Hello,

I want create function which has $segment, but if there is in address only function, not segment, I want that CI don't shows errors.

Code:
function myfunction($segment)
{
   if ($segment == NULL)
   {
       $this->load->view('page_without_segment', $data);
   }
   else
   {
       $this->load->view('page_with_segment', $data);
   }
}

I don't want disable all errors in CI, I just want answer, what's the best way to do that.

Thanks in advance! :-)




Theme © iAndrew 2016 - Forum software by © MyBB