I have the following routes configuration in a Symfony application:
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 }
linked to executeConfigure
and executeCreate
actions. Then I have a form configured this way:
<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>
Whenever the form is submitted executeConfigure
is executed, although as far as I know the route configured with POST
method should avoid that and executes executeCreate
.
How can I differentiate between these two actions keeping the same URL?
Thanks!