controller return json to vue via twig, corrections

This commit is contained in:
2021-05-27 18:41:22 +02:00
parent 65ac9a47b4
commit 9ec2a62fb6
4 changed files with 11 additions and 6 deletions

View File

@@ -209,14 +209,14 @@ class ActivityController extends AbstractController
throw $this->createNotFoundException('Template not found');
}
$activity_json = $this->serializer->serialize($entity, 'json', ['groups' => 'read']);
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'form' => $form->createView(),
'activity_json' => $activity_json
'activity_json' => $activity_array
]);
}
@@ -323,7 +323,7 @@ class ActivityController extends AbstractController
throw $this->createNotFoundException('Template not found');
}
$activity_json = $this->serializer->serialize($entity, 'json', ['groups' => ['read']]);
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, array(
'entity' => $entity,
@@ -331,7 +331,7 @@ class ActivityController extends AbstractController
'delete_form' => $deleteForm->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'activity_json' => $activity_json
'activity_json' => $activity_array
));
}