I was just wondering I was finding myself today using ALOT of }else{'s in my module access/activity script and I was wondering, if something returns either true/false. is it neccesary to script the false part of it in? or can i simply have it return only true in specifiy situations, and php will automaticaly understand otherwise its false.
for example..
switch ($Module_Info['access'])
{
case 1:
if($user->id() > 1){
return TRUE;
}else{
return FALSE;
}
break;
case 2:
if($user->lvl() == 99){
return TRUE;
}else{
return FALSE;
}
break;
default:
return TRUE;
break;
}
}else{
if($user->lvl() == 99){
return TRUE;
}else{
return FALSE;
}
}
must I use that script to show true/false or could it work with
switch ($Module_Info['access'])
{
case 1:
if($user->id() > 1){
return TRUE;
}
break;
case 2:
if($user->lvl() == 99){
return TRUE;
}
break;
default:
return TRUE;
break;
}