when i try to send data from my form to my controller, I have this error :
An exception occurred while executing a query: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type integer: "form"
CONTEXT: unnamed portal parameter $1 = ‘…’
in my view :
<form action="{{ path('handleForm') }}" method="post">
<label for="inputVariable">Variable :</label>
<input type="numeric" id="inputVariable" name="variable">
<button type="submit">Send</button>
</form>`
in my controller :
#[Route('/form', name: 'handleForm', methods: ['POST'])]
public function handleForm(Request $request): Response
{
$variable = $request->request->get('variable');
dd ($variable);
return new Response(sprintf('data : %s', htmlspecialchars($variable)));
}`
i want to send data from my view to my controller