khnum_maat 0.1.0
khnum_maat: ^0.1.0 copied to clipboard
Wires the khnum template engine into the Maat framework.
Khnum for Maat #
Wires khnum into Maat.
// bootstrap/app.dart
.withProviders([AppServiceProvider.new, ViewServiceProvider.new, ...])
// config/view.dart
final Map<String, dynamic> view = {
'paths': 'resources/views',
'cache': !envBool('APP_DEBUG'),
};
// a handler
Route.get('/', (Request request) => view('home', {'title': 'Home'}));
view(name, data) returns an HTML Response; renderView(name, data)
returns the string; View.share(name, value) adds data to every template.