本文整理匯總了PHP中Contao\System::getReferer方法的典型用法代碼示例。如果您正苦於以下問題:PHP System::getReferer方法的具體用法?PHP System::getReferer怎麽用?PHP System::getReferer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contao\System
的用法示例。
在下文中一共展示了System::getReferer方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onKernelRequest
/**
* 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);
}
示例2: compile
/**
* 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();
}
示例3: handleGetReferer
/**
* 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()));
}