/silverstripe-bootboxalert

Easily create a bootbox.js alert programatically using sessions

Primary LanguagePHPBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

silverstripe-bootboxalert

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