-
-
Save sukhikh18/8d4e33e7bf8f33d4fe34b74fa8cb9df2 to your computer and use it in GitHub Desktop.
Request API (D7) #Bitrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//use Bitrix\Main\Context; | |
use Bitrix\Main\Application; | |
//$context = Context::getCurrent(); | |
//$request = $context->getRequest(); | |
$context = Application::getInstance()->getContext(); | |
$request = Application::getInstance()->getContext()->getRequest(); | |
$bla = $request->get('bla'); | |
$value = $request->get("param"); // получение параметра GET или POST | |
$value = $request["param"]; // получение параметра GET или POST | |
$value = $request->getQuery("param"); // получение GET-параметра | |
$values = $request->getQueryList(); // получение списка GET-параметров | |
$value = $request->getPost("param"); // получение POST-параметра | |
$values = $request->getPostList(); // получение списка POST-параметров | |
$value = $request->getFile("param"); // получение загруженного файла | |
$values = $request->getFileList(); // получение списка загруженных файлов | |
$value = $request->getCookie("param"); // получение значения кука | |
$values = $request->getCookieList(); // получение списка кукисов | |
$method = $request->getRequestMethod(); // получение метода запроса | |
$flag = $request->isGet(); // true - GET-запрос, иначе false | |
$flag = $request->isPost(); // true - POST-запрос, иначе false | |
$flag = $request->isAjaxRequest(); // true - AJAX-запрос, иначе false | |
$flag = $request->isHttps(); // true - HTTPS-запрос, иначе false | |
$flag = $request->isAdminSection(); // true - находимся в админке, иначе false | |
$requestUri = $request->getRequestUri(); // Запрошенный адрес (напр. "/catalog/category/?param=value") | |
$requestPage = $request->getRequestedPage(); // Запрошенная страница (напр. "/catalog/category/index.php") | |
$rDir = $request->getRequestedPageDirectory();// Директория запрошенной страницы (напр. "/catalog/category") | |
\Bitrix\Main\HttpRequest::getSystemParameters(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment