Всем привет, как в Symfony передавать переменные между функциями. Вот пример...
/**
* @Route("/details/{builderId}", methods={"GET","POST"}, name="builder")
*/
public function builder($builderId, Request $request, DataService $dataService, BuilderService $builderService){
$builder = $builderService->getBuilder($builderId);
return $this->render('builders/details.html.twig', [
'builder' => $builder['outcome'] == 'success' ? $builder['data'] : array(),
'builderId' => $builderId
]);
}
Как мне получить переменную $builder во второй функции.
/**
* @Route("/details/building/{buildingId}", methods={"GET","POST"}, name="building")
*/
public function building($buildingId, Request $request, DataService $dataService, BuilderService $builderService){
return $this->render('builders/detailsBuilding.html.twig');
}
Как мне это сделать?