私はsymfonyのアプリケーションで、次のルートの設定を持っているの設定:は同じURLでsymfonyのルートが異なるHTTPメソッドとコントローラーアクション
executeConfigure
と
executeCreate
アクションにリンクされている
label:
url: /label
param: { module: label, action: configure }
requirements: { sf_method: get }
label_create:
url: /label
param: { module: label, action: create }
requirements: { sf_method: post }
。それから私は、このように構成されているフォーム:私の知る限りではPOST
方法で設定したルートは、それを避けるとexecuteCreate
を実行しなければならないが、フォームがexecuteConfigure
を提出されるたび
<form action="<?php echo url_for('@label_create') ?>" method="POST">
<?php echo $form->renderHiddenFields() ?>
<input type="hidden" name="sf_method" value="post" />
<!-- more stuff here -->
</form>
は、実行されます。
同じURLを保持するこれらの2つのアクションを区別するにはどうすればよいですか?
ありがとうございます!
この回答はSymfonyの古いバージョンには役立ちますが、現在のリリースでは非推奨です。どのような選択肢がありますか? –