method
public
JsonController::forward()
Сигнатура
public forward(Controller|string $controller, string $actionName[, array<string|int, mixed>|null $parameters = null ]) : HttpResponse|mixed
Параметры
$controller
Controller|string
$actionName
string
$parameters
array<string|int, mixed>|null
= null
Возвращаемое значение
HttpResponse|mixed
Как применяется в JsonController
JsonController::forward() — метод класса \Bitrix\Main\Engine\JsonController модуля «Главный модуль».
Метод объекта: сначала нужен экземпляр JsonController.
use Bitrix\Main\Engine\JsonController;
/** @var JsonController $object */
$controller = null; // Controller|string
$actionName = '';
$result = $object->forward($controller, $actionName);
// $result: HttpResponse|mixedДругие методы JsonController
className()Возвращает полностью квалифицированное имя этого класса.configureActions()convertKeysToCamelCase()Преобразует ключи массива в нотацию camelCase.finalizeResponse()Финализирует ответ.generateActionMethodName()getActionUri()Возвращает uri для ajax-эндпоинта по имени действия. Это вспомогательный метод, который использует относительное имя…getAutoWiredParameters()getConfigurationOfActions()getCurrentUser()getDefaultAutoWiredParameters()getErrorByCode()Получение единственной ошибки с необходимым кодом.getErrors()Получение массива ошибок.
forward() есть и у других классов модуля «Главный модуль»: ComponentController, Controller, DefaultController.
Исходный файл: source/main/lib/engine/jsoncontroller.php:107

