Closed
Description
This issue can be reproduced with any brand new install of Symfony 2.1.2, just generate a default bundle and add the below route.
routing.yml file
my_test_homepage:
pattern: /hello/{name}
defaults: { _controller: MyTestBundle:Default:index, name: DefaultName }
DefaultController.php
<?php
namespace My\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction($name)
{
return $this->render('MyTestBundle:Default:index.html.twig', array('name' => $name));
}
}
The route will be matched on any urls of the form http://localhost/hello/test (or other strings after hello) but the route will not be matched on urls of the form http://localhost/hello/ even though the parameter should be optional, this example is practically straight out of the Symfony2 documentation so as far as I can tell that's how it should behave.
Metadata
Metadata
Assignees
Labels
No labels