vulcandigital/silverstripe-bootboxalert

Easily create a bootbox.js alert programatically using sessions

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0.0 2018-02-23 01:11 UTC

README

Easily create a bootbox.js alert programatically using sessions

Requirements

  • silverstripe/framework: ^4

Usage

Your controller

class PageController extends ContentController {
    private static $extensions = [
        Vulcan\BootboxAlert\Extensions\BootboxAlertExtension::class    
    ];
}

In your global template (Page.ss):

$BootboxAlert

Placing this method in the template will allow the script to be added to the page requirements at the very end to ensure bootbox has been required.

Setting the alert

BootboxAlert::setAlert("Example message");

License

BSD-3-Clause - Vulcan Digital Ltd