I have this html code where i want to assign a custom value to href based on the user being authenticated in a session so when the session expires href value will change. I have the following html code:
<a href="<?php echo $value?>" >Home</a>
and the zf2 code that is dealing with the change is in the controller and is as follows:
if ($auth->hasIdentity()) {
$value='about';
}
else{
$value='';
}
return $value;
it successfully puts the href to 'about' but does not change it back to empty once the user session has been expired. I am not sure why is it not recognizing the else statement.