Ich habe ein Formular, ich möchte seinen Weg der Aktion mit js Variable ändern.symfony Zweig dynamisch von Aktionspfad
Dies ist aktuelle Arbeitscode:
if ($('#totalRecordsOfQuery').val() < 100) {
$('#postbackform').attr('action', "{{ path('_getAllRecordsStudentsProgress') }}");
$('#postbackform').submit();
$('#postbackform').attr('action', "{{ path('xyz) }}");
}
ich etwas will, wie:
var allRecordsActions = "_getAllRecordsStudentsProgress";
if ($('#totalRecordsOfQuery').val() < 100) {
$('#postbackform').attr('action', "{{ path(allRecordsActions) }}");
$('#postbackform').submit();
$('#postbackform').attr('action', "{{ path('xyz') }}");
}
Mit diesem Code, erhalte ich eine Fehlermeldung:
Variable "allRecordsActions" does not exist.
der Code befindet sich in einer Zweigdatei (oder etwas, das von der TWIG-Rendering-Engine verarbeitet wird)? – Matteo
ist es in Zweig Datei –