symfony/symfony — Issue #3226: Router won't match annotated POST method
Author: robocoder
Created: 2012-01-30 18:15:15+00:00
State: open

This causes a 500 Internal Server Error - MethodNotAllowedException. Workaround is to remove the @Method annotation.

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;

/**
* @Route("/register")
*/
class RegistrationController extends Controller
{
/**
* @Route("/new")
*/
public function registerAction()
{
$params = $this->get('router')->match('/register/create');
}

/**
* @Route("/create")
* @Method({"POST"})
*/
public function submitRegistrationAction()
{
}
}