示例#1
0
 /**
  * Returns true if current request is AJAX
  * @return bool
  */
 public function isAjaxRequest()
 {
     return $this->server->get("HTTP_BX_AJAX") !== null || $this->server->get("HTTP_X_REQUESTED_WITH") === "XMLHttpRequest";
 }
示例#2
0
 public function getScriptName()
 {
     return $this->server->getScriptName();
 }
<?php

include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/lib/loader.php";
/** @var $server \Bitrix\Main\Server */
$server = \Bitrix\Main\Server::start($_SERVER);
/** @var $application \Bitrix\Main\Application */
$application = $server->getApplication();
$application->initialize();
$application->processRequest();
// Predefined variables
/** @var $page \Bitrix\Main\Page */
$page = $application->getPage();
/** @var $request \Bitrix\Main\Request */
$request = $page->getRequest();