Signalert

Customisable & Extensible Notifications - Alerts Exactly Where You Need Them

Signalert is a PHP notifications implementation designed to allow you to communicate effectively from anywhere in your application's code to your users.

Signalert makes it simple to store messages:

$signalert = new Signalert();
$signalert->store('Notification Name', 'homepage');

Signalert makes it simple to render messages:

$signalert = new Signalert();
$signalert->render('homepage', 'error');

Signalert even makes it simple to retrieve messages as an array:

$signalert = new Signalert();
$signalert->fetch('homepage', 'error');

Signalert Works With Your Project

Signalert, out of the box, works with the standard sessions via it's SessionDriver. Also, Signalert is bundled with a series of default renderers which are pre-built using bootstrap alerts markup, with an option for switching to built-in foundation alerts markup.

Do you have a specific need for storage of notifications?

Signalert is extensible. It means that you can add your own drivers for storing notification data, and it will tie seamlessly into the way Signalert functions. Does your project use memcached or redis? Does your project save session data to the database? Signalert can be extended to support any of those mediums, and more.

Do you have a specific need for the rendering of notifications?

It's an easy assumption to make that you may want your notifications to be displayed using a particular style, framework or markup. Signalert has your back. Signalert can be extended to add your own alert types, with your own markup and style. Signalert makes it simple to plug notifications directly into your project, and make them feel at home within the design and style of your site.

Customising Signalert

By default, Signalert gives access to its SessionDriver to store messages in the default session, and also allows you to access to a simple bootstrap renderer class via its BootstrapRenderer.

You can customise any of these by writing your own classes, and specifying them within the configuration file .signalert.yml which should exist within your project root.

renderer: \Signalert\Renderer\BootstrapRenderer
driver: \Signalert\Storage\SessionDriver

Providing the full class name for each of these items will allow Signalert to understand and utilise them in its processes.

Renderer Support

Signalert is currently bundled with support for Bootstrap 3 & Foundation 5 support. All you need to do is specify which you'd like to use within your .signalert.yml file.

Bootstrap Configuration

renderer: \Signalert\Renderer\BootstrapRenderer

Foundation Configuration

renderer: \Signalert\Renderer\FoundationRenderer

Custom Markup Configuration

You can create your own renderer and link it with Signalert. We've written an interface which provides a series of simple rules for you to work with. All you need to do is ensure your renderer implements the following class: \Signalert\Renderer\RendererInterface

For the following example, assume that you have created a custom renderer at the following class path: \MyProject\MyNamespace\CustomRenderer

renderer: \MyProject\MyNamespace\CustomRenderer

Then you can use Signalert as you would normally, but this time, your custom markup will be rendered instead.

Storage Driver Support

Signalert is currently bundled with support for PHP Session support.

Session Configuration

driver: \Signalert\Storage\SessionDriver

Custom Driver Configuration

Your storage drivers have a very simple method of working. We've written an interface which provides a series of simple rules for you to work with. All you need to do is ensure your storage driver implements the following class: \Signalert\Storage\DriverInterface

For the following example, assume that you have created a custom renderer at the following class path: \MyProject\MyNamespace\CustomStorageDriver

driver: \MyProject\MyNamespace\CustomStorageDriver

Then you can use Signalert as you would normally, but this time, your custom driver will be used instead.