Download the PHP package laemmi/simple-template-engine without Composer
On this page you can find all versions of the php package laemmi/simple-template-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download laemmi/simple-template-engine
More information about laemmi/simple-template-engine
Files in laemmi/simple-template-engine
Download laemmi/simple-template-engine
More information about laemmi/simple-template-engine
Files in laemmi/simple-template-engine
Vendor laemmi
Package simple-template-engine
Short Description This is very simple template engine to parse templates
License MIT
Homepage https://github.com/laemmi/simple-template-engine
Package simple-template-engine
Short Description This is very simple template engine to parse templates
License MIT
Homepage https://github.com/laemmi/simple-template-engine
Keywords templatetemplate-engine
Please rate this library. Is it a good library?
Informations about the package simple-template-engine
Simple template engine
This is very simple template engine to parse templates.
Requirements
php 7.2
Installation
via composer
composer require laemmi/simple-template-engine
or use repository
git clone https://github.com/Laemmi/simple-template-engine.git
Usage
In this package you have to compiler. Once for replacing variable and one for if statements. For the variable compiler you can use modifiers. In default you can use all php functions like strtoupper etc.
Use with factory
$template = TemplateFactory::factory('My name is {if $name}{#name|strtoupper#}{/if} and i am {#age#} years old.');
$template->name = 'Michael';
$template->age = 99;
$template();
// My name is MICHAEL and i am 99 years old.
Use with callback modifier
$callback = new ModifierCallback('custom', function($value) {
return sprintf('Sir %s', $value);
});
$compiler = new CompileVariable();
$compiler->addModifier($callback);
$template = new Template('My name is {#name|custom#}');
$template->addPlugin($compiler);
$template->name = 'Michael';
$template();
// My name is Sir Michael
All versions of simple-template-engine with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package laemmi/simple-template-engine contains the following files
Loading the files please wait ....