CRM_Core_Page_AJAX
in package
This is base class for all ajax calls
Table of Contents
Methods
- checkAuthz() : bool
- Determine whether the request is for a valid class/method name.
- defaultSortAndPagerParams() : array<string|int, mixed>
- Set defaults for sort and pager.
- returnJsonResponse() : mixed
- Outputs the CiviCRM standard json-formatted page/form response
- run() : mixed
- Call generic ajax forms.
- setIsQuickConfig() : mixed
- Change is_quick_config priceSet to complex.
- setJsHeaders() : mixed
- Set headers appropriate for a js file.
- validateAjaxRequestMethod() : void
- Guards against CSRF by validating the request method appears to be an ajax request
- validateParams() : array<string|int, mixed>
- Validate ajax input parameters.
Methods
checkAuthz()
Determine whether the request is for a valid class/method name.
public
static checkAuthz(string $type, string $className[, string $fnName = NULL ]) : bool
Parameters
- $type : string
-
'method'|'class'|''.
- $className : string
-
'Class_Name'.
- $fnName : string = NULL
-
Method name.
Return values
booldefaultSortAndPagerParams()
Set defaults for sort and pager.
public
static defaultSortAndPagerParams([int $defaultOffset = 0 ][, int $defaultRowCount = 25 ][, string $defaultSort = NULL ][, string $defaultsortOrder = 'asc' ]) : array<string|int, mixed>
Parameters
- $defaultOffset : int = 0
- $defaultRowCount : int = 25
- $defaultSort : string = NULL
- $defaultsortOrder : string = 'asc'
Return values
array<string|int, mixed>returnJsonResponse()
Outputs the CiviCRM standard json-formatted page/form response
public
static returnJsonResponse(array<string|int, mixed>|string $response) : mixed
Parameters
- $response : array<string|int, mixed>|string
run()
Call generic ajax forms.
public
static run() : mixed
setIsQuickConfig()
Change is_quick_config priceSet to complex.
public
static setIsQuickConfig() : mixed
setJsHeaders()
Set headers appropriate for a js file.
public
static setJsHeaders([int|null $ttl = NULL ]) : mixed
Parameters
- $ttl : int|null = NULL
-
Time-to-live (seconds).
validateAjaxRequestMethod()
Guards against CSRF by validating the request method appears to be an ajax request
public
static validateAjaxRequestMethod() : void
validateParams()
Validate ajax input parameters.
public
static validateParams([array<string|int, mixed> $requiredParams = [] ][, array<string|int, mixed> $optionalParams = [] ]) : array<string|int, mixed>
Parameters
- $requiredParams : array<string|int, mixed> = []
- $optionalParams : array<string|int, mixed> = []