Skip to content

Commit

Permalink
Implement Registrar
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Jul 22, 2022
1 parent a5a4265 commit 96d3716
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if (! $fruit = $this->getPost('fruit')) {
}
```

### Alerts Helper
### Helper

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

### Collector

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

## Warnings

The premise of this library is to take data from `$_SESSION` and display it to visitors of
Expand Down
11 changes: 0 additions & 11 deletions src/Config/Filters.php

This file was deleted.

27 changes: 27 additions & 0 deletions src/Config/Registrar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Tatter\Alerts\Config;

use Tatter\Alerts\Collectors\Alerts;
use Tatter\Alerts\Filters\AlertsFilter;

class Registrar
{
public static function Filters(): array
{
return [
'aliases' => [
'alerts' => AlertsFilter::class,
],
];
}

public static function Toolbar(): array
{
return [
'collectors' => [
Alerts::class,
],
];
}
}

0 comments on commit 96d3716

Please sign in to comment.