private function getEditReferrer(Request $request)
    {
        $tmp = parse_url($request->server->get('HTTP_REFERER'));

        $referrer = $tmp['path'];
        if (!empty($tmp['query'])) {
            $referrer .= '?' . $tmp['query'];
        }

        if (strpos($referrer, '/overview/') !== false || ($referrer === $this->generateUrl('dashboard') . '/')) {
            if ($this->getOption('general/compatibility/twig_globals', true)) {
                $this->app['twig']->addGlobal('editreferrer', $referrer);
            }

            return $referrer;
        }

        return null;
    }
private function getEditReferrer(Request $request)
    {
        $tmp = parse_url($request->server->get('HTTP_REFERER'));

        $referrer = $tmp['path'];
        if (!empty($tmp['query'])) {
            $referrer .= '?' . $tmp['query'];
        }

        if (strpos($referrer, '/overview/') !== false || ($referrer === $this->generateUrl('dashboard') . '/')) {
            if ($this->getOption('general/compatibility/twig_globals', true)) {
                $this->app['twig']->addGlobal('editreferrer', $referrer);
            }

            return $referrer;
        }

        return null;
    }
private function getEditReferrer ( Request $ request ) { $ tmp = parse_url ( $ request -> server -> get ( 'HTTP_REFERER' ) ) ; $ referrer = $ tmp [ 'path' ] ; if ( ! empty ( $ tmp [ 'query' ] ) ) { $ referrer .= '?' . $ tmp [ 'query' ] ; } if ( strpos ( $ referrer , '/overview/' ) !== false || ( $ referrer === $ this -> generateUrl ( 'dashboard' ) . '/' ) ) { if ( $ this -> getOption ( 'general/compatibility/twig_globals' , true ) ) { $ this -> app [ 'twig' ] -> addGlobal ( 'editreferrer' , $ referrer ) ; } return $ referrer ; } return null ; }
Set the editreferrer in twig if it was not set yet.

@param Request $request

@return string|null
Set the editreferrer in twig if it was not set yet .