Welcome Guest, Not a member yet? Register   Sign In
[Solved] isset not working correct.
#4

(04-22-2015, 07:29 AM)kilishan Wrote: The problem is that the variables $page_id and $path are set so will always evaluate to TRUE. Use empty() instead


Code:
$page_id = $this->input->get('page_id');
$path = $this->input->get('path');
$route = $this->uri->segment(1).'/'.$this->uri->segment(2);

if ($route != '/')
{
   if (! empty($page_id))
   {
       $class = '-' . $page_id;
   } elseif (! empty($path))
   {
       $class = '-' . $path;
   } else
  {
       $class = '';
   }
}

Thanks every one works great now.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: isset not working correct. - by kilishan - 04-22-2015, 07:29 AM
RE: isset not working correct. - by wolfgang1983 - 04-22-2015, 08:18 AM
RE: isset not working correct. - by CroNiX - 04-22-2015, 07:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB