khnum_maat 0.1.0 copy "khnum_maat: ^0.1.0" to clipboard
khnum_maat: ^0.1.0 copied to clipboard

Wires the khnum template engine into the Maat framework.

example/example.dart

import 'dart:io';

import 'package:khnum_maat/khnum_maat.dart';
import 'package:maat/maat.dart';

Future<void> main() async {
  final root = Directory.systemTemp.createTempSync('khnum_maat_example');
  File('${root.path}/resources/views/welcome.khnum.html')
    ..createSync(recursive: true)
    ..writeAsStringSync('Welcome, {{ name }}!');

  try {
    await Application.configure(basePath: root.path, environment: {})
        .withConfig({
          'app': {'name': 'Maat', 'debug': true},
          'view': {'paths': 'resources/views'},
        })
        .withProviders([ViewServiceProvider.new])
        .create();

    print(await renderView('welcome', {'name': 'Ada'}));
  } finally {
    Application.reset();
    root.deleteSync(recursive: true);
  }
}
0
likes
160
points
0
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Wires the khnum template engine into the Maat framework.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

khnum, maat, path

More

Packages that depend on khnum_maat