Skip to content

Support X-Alertify-Trigger custom header to force the alert trigger on kernel.response

Compare
Choose a tag to compare
@lenybernard lenybernard released this 30 Nov 14:58
· 23 commits to master since this release
24fe2ff

Custom header

If you want to force the trigger of an alert, after an ajax call for example, you need to send through the response a custom header : X-Inject-Alertify. When its value is set to true, then the alert append at the end of the response content, even if it is empty. Note that the 204 status code (No content) is incompatible with this header, as the 204 response MUST NOT include a message-body.

Example :

return new Response(null, 200, [
	'X-Inject-Alertify' => true
]);