Download the PHP package comhon-project/template-renderer without Composer
On this page you can find all versions of the php package comhon-project/template-renderer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download comhon-project/template-renderer
More information about comhon-project/template-renderer
Files in comhon-project/template-renderer
Package template-renderer
Short Description PHP library that permit to render templates and permit to define which renderer to use
License MIT
Homepage https://github.com/comhon-project/template-renderer
Informations about the package template-renderer
PHP Template Renderer
- Your library needs to render templates (example: email template) but you don't want to implement it ?
- You want your template renderer to be customizable by developers that use your library ?
This library is made for that! it permit to render templates and permit to define which renderer to use. This library is generally intended for Laravel projects but you can use it even if you are not implementing a Laravel project.
There is only one renderer available by default (twig), but you can add your own by defining your own driver.
Installation
You can install the package via composer:
For laravel project, you can publish the config file with:
Usage
Laravel project
Non Laravel project
Adding custom renderer driver
First, you will have to define a class that implements Comhon\TemplateRenderer\Renderers\RendererInterface
Then, you will have to register your driver by calling the Template
facade's extend
method:
In laravel project, you may call this function in the boot
method of your AppServiceProvider
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of template-renderer with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/contracts Version ^10.0|^11.0
twig/intl-extra Version ^3.7
twig/twig Version ^3.0