Slim 2.6 loading page

Hi, I’m an intern in a web development company. They asked me to make a loading page because one of my controller’s method is pretty long (25s) and they want to see a loading page while, well, it loads.
I have no idea how to do that since I’ve never used Slim before, I’ve been trying a few things, for example onload() events but none of it seems to work.
Can someone help me?
Thanks a lot,