I try to get CSRF token from my form to send it through Ajax response. This is my code:
$uploadForm = $this->createForm(new FilesUploadType(), new FilesUpload(), [
'action' => $this->generateUrl('files_upload')
])->handleRequest($request);
I have tried to get that so:
$uploadForm->get('_token').getData();
But that doesn't works.