I'm newbie in Symfony and I'm following a tutorial. The first excercise is very simple, but I don't know why is not working.
In my source folder I first tried with these lines:
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class GenusController
{
/**
* @Route("/genus")
*/
public function showAction()
{
return new Response('Test ');
}
}
I tried in in my browser:
http://localhost:8888/my_project/web/genus
And it works. But then if I add new lines:
class GenusController
{
/**
* @Route("/genus/{genusName}")
*/
public function showAction($genusName)
{
return new Response('The genus: '.$genusName);
}
}
and tested it:
http://localhost:8888/my_project/web/genus/test
My browser displays:
Oops! An Error Occurred The server returned a "404 Not Found". Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
What is missing? Any suggestions?
Thank you in advance
php bin/console server:start? If you do, the proper url should be:http://localhost:8888/genus/something- Boris Guéry