https://github.com/ppeco/tplpp
Library for templates
https://github.com/ppeco/tplpp
php ppeco template-engine template-engine-html templates-html
Last synced: 3 months ago
JSON representation
Library for templates
- Host: GitHub
- URL: https://github.com/ppeco/tplpp
- Owner: ppeco
- License: mit
- Created: 2021-08-06T10:15:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-15T18:28:47.000Z (over 4 years ago)
- Last Synced: 2025-07-29T23:24:36.377Z (9 months ago)
- Topics: php, ppeco, template-engine, template-engine-html, templates-html
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tplpp
```shell
composer require ppeco/tplpp
```
Library for templates
## Example
```php
use ppeco\tplpp\Template;
// From string
$template = new Template("Hello, {{\$variable.'!'}}");
//..or from file
$template = Template::fromFile("./example.tpl");
echo $template->addValue("variable", "World"); // Output: Hello, World!
//Alternative
echo $template->addValues([
"variable" => "World"
]);
```