Skip to content
Advertisement

How to create a redirect to an html file in a php condition on symfony?

how to create a redirect to an html file in a php condition on symfony please? I want that if the counter is greater than 4 there is a redirection to an html page.

if (count > 4){
// Redirect html file  (add html file example.html.twig)
}

Advertisement

Answer

Try this one

if (count > 4){
$script = "<script> window.location = 'example.html.twig';</script>";
echo $script;
}
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement