79173373

Date: 2024-11-09 17:56:15
Score: 0.5
Natty:
Report link

Your Controller will be like:

#[Route('/place_payment/{id}', name: 'place_payment', methods: ['GET', 'POST'])]
public function addPayment(Request $request, Place $place, int $id): Response
    {
        $idPayment = (int) $request->query->get('idPayment');

And your TWIG will be like:

{% for payment in existingPayments %}
   <a href="{{ path('user_place_payment', {'id': place.id, 'idPayment': payment.id }) }}">{{ payment.name }} - delete this payment method</a><br><br>
{% endfor %} 
{% for payment in missingPayments %}
    <a href="{{ path('user_place_payment', {'id': place.id, 'idPayment': payment.id }) }}">{{ payment.name }} - add this payment method</a><br><br>
{% endfor %} 

So, you get URL like your_server/place_payment/103?idPayment=3

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Konstantin