Document location to twig template

I have some buttons with onclick functions that take you to a php page with ‘document.location’ but I’m pretty sure that’s not the Grav way of doing things. So how does one make onclick events take you to a twig template that displays the page?