G
G
gitdev2021-05-23 03:25:02
symfony
gitdev, 2021-05-23 03:25:02

Where is it better to place JsonResponse in a service or in a controller and why?

public function change(Request $request): JsonResponse
    {
        $result = $this->localeService->setLocale($request);

        return new JsonResponse($result, $result['status']);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tukreb, 2021-05-23
@gitdev

https://translate.google.com/?sl=en&tl=en&text=Res...
It's obvious what's in the controller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question