This package is to ease using flash message between your views
Update your Package.swift
file.
.package(url: "https://github.com/nodes-vapor/flash.git", from: "2.0.0-beta")
TODO. While we make the docs, feel free to look at how Admin Panel uses this package.
The below example uses the Vapor 3 Bootstrap package for generating the alert html.
<div class="alerts">
#flash() {
#for(flash in all) {
#bs:alert(flash.bootstrapType) {
#(flash.message)
}
}
}
</div>
Add the Flash html to one file and embed it in rest of your views or through a base layout, e.g.: #embed("alerts")
.
This package is developed and maintained by the Vapor team at Nodes. The package owner for this project is Brett.
This package is open-sourced software licensed under the MIT license