Skip to content

Commit

Permalink
create doc for custom header purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
adpdsr committed Nov 30, 2017
1 parent 0fb2a86 commit 2b4daea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ With Alertify, give the final user a unique and harmnized view f your notificati
- [Installation](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/installation.md)
- [Configuration](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/configuration.md)
- [Getting started](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/getting_started.md)
- [Advanced (modal, confirmation modal)](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/advanced.md)
- [Advanced (modal, confirmation modal, custom header)](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/advanced.md)
- [Pro tips](https://github.com/Troopers/TroopersAlertifyBundle/blob/master/Resources/doc/pro_tips.md)
12 changes: 12 additions & 0 deletions Resources/doc/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ Instead of that, the js we'll be ran.
```html
<a href="/your_url" class="btn btn-mini btn-danger" data-toggle="confirm" data-title="Are you sure ?" data-body="Kittens will suffer ! Do you confirm ?" data-cancel-button-class="cancel" data-confirm-button-class="danger">Burn some cats</a>
```

## 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 :

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

0 comments on commit 2b4daea

Please sign in to comment.