added switch statement to the js ref and added the php ref