Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController::getOkResponse PHP Method

getOkResponse() protected method

This method takes into account the type of the request ( GET or POST )
protected getOkResponse ( Request $request, string $redirectPath = null ) : mixed
$request Symfony\Component\HttpFoundation\Request Request
$redirectPath string Redirect path
return mixed Response
    protected function getOkResponse(Request $request, $redirectPath = null)
    {
        if (null === $redirectPath) {
            $redirectUrl = $request->headers->get('referer');
        } else {
            $redirectUrl = $request->getUriForPath($redirectPath);
        }
        return $request->isMethod(Request::METHOD_GET) ? $this->redirect($redirectUrl) : new Response(json_encode(['result' => 'ok', 'code' => '0', 'message' => '']));
    }