mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-26 01:23:49 +00:00
controller return json to vue via twig; init vue App
This commit is contained in:
@@ -209,19 +209,8 @@ class ActivityController extends AbstractController
|
||||
throw $this->createNotFoundException('Template not found');
|
||||
}
|
||||
|
||||
//$activity_json = $this->serializer->serialize($entity, 'json', []);
|
||||
// "A circular reference has been detected when serializing the object of class "Chill\PersonBundle\Entity\AccompanyingPeriod" (configured limit: 1)."
|
||||
$activity_json = $this->serializer->serialize($entity, 'json', ['groups' => 'read']);
|
||||
|
||||
$activity_json = null;
|
||||
// activity_json doit retourner qqch comme :
|
||||
// {
|
||||
// "type": "activity",
|
||||
// "persons": [
|
||||
// { type: person, id: xxx, ...}
|
||||
// { ...}
|
||||
// ], ""
|
||||
// }
|
||||
|
||||
return $this->render($view, [
|
||||
'person' => $person,
|
||||
'accompanyingCourse' => $accompanyingPeriod,
|
||||
@@ -334,13 +323,15 @@ class ActivityController extends AbstractController
|
||||
throw $this->createNotFoundException('Template not found');
|
||||
}
|
||||
|
||||
$activity_json = $this->serializer->serialize($entity, 'json', ['groups' => ['read']]);
|
||||
|
||||
return $this->render($view, array(
|
||||
'entity' => $entity,
|
||||
'edit_form' => $form->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
'person' => $person,
|
||||
'accompanyingCourse' => $accompanyingPeriod,
|
||||
'activity_json' => null
|
||||
'activity_json' => $activity_json
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user