schranz-templating / symfony-handlebars-integration
A integration of template renderer into symfony via handlebars template engine.
Requires
- php: ^7.0 || ^8.0
- salesforce/handlebars-php: ^2.3 || ^3.0
- schranz-templating/handlebars-adapter: ^0.1
- symfony/config: ^4.4 || ^5.4 || ^6.0
- symfony/dependency-injection: ^4.4 || ^5.4 || ^6.0
- symfony/http-kernel: ^4.4 || ^5.4 || ^6.0
README
Integrate the templating Handlebars Adapter into the Symfony Framework.
Part of the Schranz Templating Project.
Installation
Install this package via Composer:
composer require schranz-templating/symfony-handlebars-integration
Register the Bundle class in your config/bundles.php
or Kernel file:
return [ // ... Schranz\Templating\Integration\Symfony\Handlebars\SchranzTemplatingHandlebarsBundle::class => ['all' => true], ];
Configuration
The Handlebars Integration has the following configuration available:
schranz_templating_handlebars: default_path: '%kernel.project_dir%/templates' cache: '%kernel.cache_dir%/handlebars'
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 Handlebars templates by default.
cache
type: string
default: '%kernel.cache_dir%/handlebars'
Before using the Handlebars 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.