I'm new to Symfony and am trying to understand that controller response function. I just want to return a simple HTML file home.html, that at the moment just has a Hello World line in it.
How do I return the file as a response? As it stands with the code below it's just returning the string 'home.html'.
Many thanks.
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MainController
{
/**
* @Route("/")
*/
public function homepage()
{
return new Response('home.html');
}
}