awema-pl/module-system-notify

Module for display notifications in theme.

v1.0.9 2021-12-14 10:01 UTC

This package is auto-updated.

Last update: 2024-04-14 15:13:55 UTC


README

Composer Ready Downloads Last version

This is where your description should go. Take a look at contributing.md to see a to do list.

Documentation

Russian

NPM scripts

Development mode npm run watch or simply npm start Development mode for IE npm run watch:legacy Production build npm run build

Installation

Via Composer

$ composer require awema-pl/module-system-notify

The package will automatically register itself.

Usage

Create a container to display notifications in:

@notify(['name' => 'container', 'stack' => false, 'config' => "{theme: 'inline', timeout: 0}"])

More info about custom containers

// notify in different styles to specific container
Notify::info('title', 'message')->to('container');
Notify::error('title', 'message')->to('container');
Notify::warning('title', 'message')->to('container');
Notify::success('title', 'message')->to('container');

// add button to notification
Notify::notify('title', 'message', 'success')
    ->withButton([
        'text' => 'Install now', // button cta text, required
        'url' => '/path', // required
        'data' => [ 'param' => 'some param' ], // payload, if needed
        'method' => 'patch'// if needed, POST by default
    ])->to('container');

More info about notification options

Helper function also available:

alert('title', 'message', 'info')->to('container');

Messages allowed to include basic HTML:

alert('title', '<a href="/path">message</a>', 'info')->to('container');

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker.

Credits

License

GNU General Public License v3.0. Please see the license file for more information.