Foyle's contract was due to expire in the summer, but was delighted to extend his stay at the Valiants.
He said: "I am absolutely delighted. It shows the loyalty the chairman has shown in me and vice versa.
"I've been here fifteen years now, worked very hard for the club and I have just got the reward of a two-year deal.
"Now I need to get my staff in place and get them signing contracts, which hopefully will be done over the next few days, and we just look forward to the future."