schranz-templating/symfony-mustache-integration

A integration of template renderer into symfony via mustache template engine.

0.1.0 2022-09-17 15:53 UTC

This package is auto-updated.

Last update: 2024-11-29 06:23:18 UTC


README

Integrate the templating Mustache Adapter into the Symfony Framework.

Part of the Schranz Templating Project.

Installation

Install this package via Composer:

composer require schranz-templating/symfony-mustache-integration

Register the Bundle class in your config/bundles.php or Kernel file:

return [
    // ...
    Schranz\Templating\Integration\Symfony\Mustache\SchranzTemplatingMustacheBundle::class => ['all' => true],
];

Configuration

The Mustache Integration has the following configuration available:

schranz_templating_mustache:
    default_path: '%kernel.project_dir%/templates'
    cache: '%kernel.cache_dir%/mustache'

None of the configuration is required.

default_path

type: string default: '%kernel.project_dir%/templates'

The path to the directory where Symfony will look for the application Mustache templates by default.

cache

type: string default: '%kernel.cache_dir%/mustache'

Before using the Mustache templates to render some contents, they are compiled into regular PHP code. Compilation is a costly process, so the result is cached in the directory defined by this configuration option.