Im completely new to Symfony so please bear with me. Im trying to configure my controller to atleast get a working webpage. I created a new Symfony project and started my server. After writing some code into MyController
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class MyController
{
/**
* @Route("/test")
*/
public function numberAction()
{
$prankBro= "Its just a prank bro";
return new Response($prankBro);
}
}
After trying to access localhost:8000
I get a fatal 404 error: No route found for "GET /"
Being a complete beginner I have no idea what this is. I believe it is some kind of response type, although I'm not sure. On the other hand if I use localhost:8000/test
It seems to be working fine, I get my webpage with a message saying that it was just a prank bro :) Is this how it is supposed to be in symfony? It really messes up with my brain, so if it is fine, can someone explain me why plain localhost:8000
URL gives me 404 error? Thank you!