这是我的路由:
myapp_upgradeAccount:
path: /upgradeAccount
defaults: { _controller: myapp:UpgradeAccount:index }
myapp_checkUsernameForUpgrade:
path: /upgradeAccount/check/{username}
defaults: { _controller: myapp:UpgradeAccount:checkUsername }
methods: [GET]
这是我的表格
<form method="get" action="upgradeAccount/check">
<label for="username">Insert your username:</label>
<input name="username" type="text">
<input id="chech-username-for-upgrade" class="green" type="submit" value="Check">
...
但是每次我提交表单时,我都会收到此错误:
No route found for "GET /upgradeAccount/check"
问题是当我提交表单时,我得到以下 URL:
http://localhost/app_dev.php/upgradeAccount/check?username=123
当我认为我应该得到
http://localhost/app_dev.php/upgradeAccount/check/123
如果我手动 trz 后者,它可以正常工作。我错过了什么?