I would like to check if the construction of PHP multiple conditions are correct.
if ($role == 'admin') :
$active_admin = 'active';
elseif ($role == 'mods') :
$active_mods = 'active';
elseif ($role == 'writer') :
$active_writer = 'active';
endif;
However, i noticed that there are undefined variables inside my class attribute. What i wanted to know was, "Do i need to create additional conditions to avoid getting Undefined Variable?"
Because in this statement, admin was initialize as active role, then the rest was idle. I get this notification after viewing it in my source.
<br />
<b>Notice</b>: Undefined variable: active_admin in...
Thanks for the suggestions or comments. Appreciate it.