Skip to content

Commit 96d3716

Browse files
committed
Implement Registrar
1 parent a5a4265 commit 96d3716

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ if (! $fruit = $this->getPost('fruit')) {
115115
}
116116
```
117117

118-
### Alerts Helper
118+
### Helper
119119

120120
This library also includes a helper function, which has the added benefit of merging values
121121
and checking for collision. Initialize the helper to us the convenience wrapper function:
@@ -127,6 +127,12 @@ alert('error', 'You must accept the terms of service to continue.');
127127
The helper adds a few features (like collision detection and alert merging) but may throw
128128
exceptions in some circumstances - read the **Collision** section below.
129129

130+
### Collector
131+
132+
There is a [Toolbar Collector](https://www.codeigniter.com/user_guide/testing/debugging.html#creating-custom-collectors)
133+
bundled with this library to ease development and integration. It is enabled by default and
134+
should appear in the development environment whenever the Toolbar is active.
135+
130136
## Warnings
131137

132138
The premise of this library is to take data from `$_SESSION` and display it to visitors of

src/Config/Filters.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/Config/Registrar.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace Tatter\Alerts\Config;
4+
5+
use Tatter\Alerts\Collectors\Alerts;
6+
use Tatter\Alerts\Filters\AlertsFilter;
7+
8+
class Registrar
9+
{
10+
public static function Filters(): array
11+
{
12+
return [
13+
'aliases' => [
14+
'alerts' => AlertsFilter::class,
15+
],
16+
];
17+
}
18+
19+
public static function Toolbar(): array
20+
{
21+
return [
22+
'collectors' => [
23+
Alerts::class,
24+
],
25+
];
26+
}
27+
}

0 commit comments

Comments
 (0)