Ik ben gek geworden over dit stuk code en heb het verkleind tot de niet-ingestelde functie. Wanneer ik aanroep op de sessievariabele bellen, voert PHP niets meer uit dan dat punt. Kan iemand alsjeblieft helpen?
public static function print_session_notification() {
if( isset( $_SESSION['notification'] )) {
$session_notification = $_SESSION['notification'];
$output = '<div class="error">';
$output .= $_SESSION['notification'];
$output .= '</div>';
unset( $_SESSION['notification'] );
return $output;
}
}
Ik noem printmelding: print_session_notification (); van een header inclusief. De koptekst bevat wordt aangeroepen door een functie. Het $ notification-object is globaal in de functie die het header-bestand aanroept.