class Ajax (View source)

Methods

bool
isAjaxRequest(Request $request)

Check if a request is an Ajax call.

sendResult(mixed $result) deprecated

Sends a result to the client and ends the execution.

sendError(mixed $error) deprecated

Sends an error to the client and ends the execution.

Details

bool isAjaxRequest(Request $request)

Check if a request is an Ajax call.

Parameters

Request $request

Return Value

bool

sendResult(mixed $result) deprecated

deprecated You should switch to something like: return \Core::make(\Concrete\Core\Http\ResponseFactoryInterface::class)->json(...)

Sends a result to the client and ends the execution.

Parameters

mixed $result

sendError(mixed $error) deprecated

deprecated You should switch to something like: return \Core::make(\Concrete\Core\Http\ResponseFactoryInterface::class)->json(...)

Sends an error to the client and ends the execution.

Parameters

mixed $error