public __construct ( string $url, array $params = [], string $options = true, boolean | string $validator = null ) |
$url |
string |
- the url to call via ajax |
$params |
array |
- request vars |
$options |
string |
- array of options like { "type": "POST", "dataType": "jsonp", "data": { "token": "value" } } |
$validator |
boolean | string |
- custom validator or "reverse"
By default, all 2xx ajax returs are considered valid, all others failure.
You can show frontend server-side specific error messages by returning a 404 error with the error message in the body of the response |