handlebars

command module
v0.0.0-...-3b77b35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 6 Imported by: 0

README

Handlebars plugin

This plugin is a wrapper for the Handlebars for golang library.

Installation

Follow the instructions in our manual to add our package repository and then run the below command.

Ubuntu
apt-get install halon-extras-handlebars
RHEL
yum install halon-extras-handlebars

Exported functions

These functions needs to be imported from the extras://handlebars module path.

handlebars(template, context)

Render a handlebars template.

Params

  • template string - The template
  • context array - The context

Returns

A successful render will return an associative array with a result key that contains the HTML. On error an associative array with a error key will be provided.

Example

import { handlebars } from "extras://handlebars";

$template = ''<div>
  <h1>{{title}}</h1>
  <div class="body">
    {{body}}
  </div>
</div>
'';

echo handlebars($template, [
    "title" => "This is my title",
    "body" =>  "This is my body"
]);

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL