getReferer() public static méthode

Return the referer URL and optionally encode ampersands
public static getReferer ( boolean $blnEncodeAmpersands = false, string $strTable = null ) : string
$blnEncodeAmpersands boolean If true, ampersands will be encoded
$strTable string An optional table name
Résultat string The referer URL
 /**
  * Toggles the TL_VIEW cookie and redirects back to the referring page.
  *
  * @param GetResponseEvent $event The event object
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     if (!$this->isFrontendMasterRequest($event) || !$request->query->has('toggle_view')) {
         return;
     }
     $this->framework->initialize();
     $response = new RedirectResponse(System::getReferer(), 303);
     $response->headers->setCookie($this->getCookie($request->query->get('toggle_view'), $request->getBasePath()));
     $event->setResponse($response);
 }
 /**
  * Generate the module
  *
  * @throws \Exception
  */
 protected function compile()
 {
     if (Input::get($this->redirectParamName)) {
         $this->redirectToModule(Input::get($this->redirectParamName, true));
     }
     System::loadLanguageFile('seo_serp_module');
     $this->Template->backHref = System::getReferer(true);
     $modules = $this->getModules();
     if (count($modules) > 0) {
         $GLOBALS['TL_CSS'][] = 'system/modules/seo_serp_preview/assets/css/module.min.css';
         $GLOBALS['TL_CSS'][] = 'system/modules/seo_serp_preview/assets/css/tests.min.css';
         $this->Template->modules = $this->generateModules($modules);
     }
     // Rebuild the cache in status manager
     $statusManager = new StatusManager();
     $statusManager->rebuildCache();
 }
 /**
  * Retrieve the current referrer url.
  *
  * @param GetReferrerEvent $event The event.
  *
  * @return void
  */
 public function handleGetReferer(GetReferrerEvent $event)
 {
     $event->setReferrerUrl(System::getReferer($event->isEncodeAmpersands(), $event->getTableName()));
 }