dartian_view 1.0.0 copy "dartian_view: ^1.0.0" to clipboard
dartian_view: ^1.0.0 copied to clipboard

Server-side rendering (SSR) views for Dartian using Mustache templates with i18n support

dartian_view #

Server-side rendering (SSR) views for Dartian using Mustache templates with i18n support.

Features #

  • Mustache template engine
  • Layouts and partials
  • i18n integration
  • Auto-escaping for security

Installation #

dependencies:
  dartian_view: ^1.0.0

Usage #

import 'package:dartian_view/dartian_view.dart';

// Create view engine
final engine = ViewEngine(
  viewsPath: 'resources/views',
);

// Render a template
final html = await engine.render('welcome', {
  'name': 'John',
  'items': ['Apple', 'Banana', 'Orange'],
});

// With layout
final page = await engine.render('home', data, layout: 'layouts/main');

Template Syntax #

<!-- resources/views/welcome.mustache -->
<h1>Welcome, {{name}}!</h1>
<ul>
  {{#items}}
    <li>{{.}}</li>
  {{/items}}
</ul>

Part of Dartian #

This package is part of the Dartian framework.

License #

AGPL-3.0 - See LICENSE for details.

0
likes
130
points
130
downloads

Publisher

verified publisherdartian.org

Weekly Downloads

Server-side rendering (SSR) views for Dartian using Mustache templates with i18n support

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#template #mustache #ssr #views

Documentation

API reference

License

unknown (license)

Dependencies

dartian_core, dartian_i18n, mustache_template, shelf

More

Packages that depend on dartian_view